chore(dokploy): simplify migrations

This commit is contained in:
Mauricio Siu
2024-10-23 01:16:42 -06:00
parent 7e76eb4dd1
commit dfdedf9e48
10 changed files with 45 additions and 11875 deletions

View File

@@ -0,0 +1,12 @@
DO $$ BEGIN
CREATE TYPE "public"."serverStatus" AS ENUM('active', 'inactive');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "admin" ADD COLUMN "stripeCustomerId" text;--> statement-breakpoint
ALTER TABLE "admin" ADD COLUMN "stripeSubscriptionId" text;--> statement-breakpoint
ALTER TABLE "admin" ADD COLUMN "serversQuantity" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
ALTER TABLE "auth" ADD COLUMN "resetPasswordToken" text;--> statement-breakpoint
ALTER TABLE "auth" ADD COLUMN "resetPasswordExpiresAt" text;--> statement-breakpoint
ALTER TABLE "server" ADD COLUMN "serverStatus" "serverStatus" DEFAULT 'active' NOT NULL;

View File

@@ -1,3 +0,0 @@
ALTER TABLE "admin" ADD COLUMN "stripeCustomerId" text;--> statement-breakpoint
ALTER TABLE "admin" ADD COLUMN "stripeSubscriptionId" text;--> statement-breakpoint
ALTER TABLE "admin" ADD COLUMN "totalServers" integer DEFAULT 0 NOT NULL;

View File

@@ -1 +0,0 @@
ALTER TABLE "admin" ADD COLUMN "stripeSubscriptionStatus" text;

View File

@@ -1,9 +0,0 @@
DO $$ BEGIN
CREATE TYPE "public"."serverStatus" AS ENUM('active', 'inactive');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
ALTER TABLE "admin" RENAME COLUMN "totalServers" TO "serversQuantity";--> statement-breakpoint
ALTER TABLE "server" ADD COLUMN "serverStatus" "serverStatus" DEFAULT 'active' NOT NULL;--> statement-breakpoint
ALTER TABLE "admin" DROP COLUMN IF EXISTS "stripeSubscriptionStatus";

View File

@@ -1,2 +0,0 @@
ALTER TABLE "auth" ADD COLUMN "resetPasswordToken" text;--> statement-breakpoint
ALTER TABLE "auth" ADD COLUMN "resetPasswordExpiresAt" text;

View File

@@ -1,5 +1,5 @@
{
"id": "eb2c64cb-bf3e-44c1-b4f2-a9f41dd8b80b",
"id": "9933f3e8-77a2-40e6-b579-922fe6bb2cb6",
"prevId": "22cf0495-c3f3-4601-8653-9fb9a66bb72d",
"version": "6",
"dialect": "postgresql",
@@ -888,8 +888,8 @@
"primaryKey": false,
"notNull": false
},
"totalServers": {
"name": "totalServers",
"serversQuantity": {
"name": "serversQuantity",
"type": "integer",
"primaryKey": false,
"notNull": true,
@@ -974,6 +974,18 @@
"type": "text",
"primaryKey": false,
"notNull": true
},
"resetPasswordToken": {
"name": "resetPasswordToken",
"type": "text",
"primaryKey": false,
"notNull": false
},
"resetPasswordExpiresAt": {
"name": "resetPasswordExpiresAt",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
@@ -3725,6 +3737,14 @@
"primaryKey": false,
"notNull": true
},
"serverStatus": {
"name": "serverStatus",
"type": "serverStatus",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"sshKeyId": {
"name": "sshKeyId",
"type": "text",
@@ -3917,6 +3937,14 @@
"gitlab",
"bitbucket"
]
},
"public.serverStatus": {
"name": "serverStatus",
"schema": "public",
"values": [
"active",
"inactive"
]
}
},
"schemas": {},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -292,29 +292,8 @@
{
"idx": 41,
"version": "6",
"when": 1729314952330,
"tag": "0041_small_aaron_stack",
"breakpoints": true
},
{
"idx": 42,
"version": "6",
"when": 1729455812207,
"tag": "0042_smooth_swordsman",
"breakpoints": true
},
{
"idx": 43,
"version": "6",
"when": 1729472842572,
"tag": "0043_legal_power_pack",
"breakpoints": true
},
{
"idx": 44,
"version": "6",
"when": 1729580119063,
"tag": "0044_wandering_butterfly",
"when": 1729667438853,
"tag": "0041_huge_bruce_banner",
"breakpoints": true
}
]