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
@@ -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;
@@ -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;
@@ -1 +0,0 @@
ALTER TABLE "admin" ADD COLUMN "stripeSubscriptionStatus" text;
@@ -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";
@@ -1,2 +0,0 @@
ALTER TABLE "auth" ADD COLUMN "resetPasswordToken" text;--> statement-breakpoint
ALTER TABLE "auth" ADD COLUMN "resetPasswordExpiresAt" text;
+31 -3
View File
@@ -1,5 +1,5 @@
{ {
"id": "eb2c64cb-bf3e-44c1-b4f2-a9f41dd8b80b", "id": "9933f3e8-77a2-40e6-b579-922fe6bb2cb6",
"prevId": "22cf0495-c3f3-4601-8653-9fb9a66bb72d", "prevId": "22cf0495-c3f3-4601-8653-9fb9a66bb72d",
"version": "6", "version": "6",
"dialect": "postgresql", "dialect": "postgresql",
@@ -888,8 +888,8 @@
"primaryKey": false, "primaryKey": false,
"notNull": false "notNull": false
}, },
"totalServers": { "serversQuantity": {
"name": "totalServers", "name": "serversQuantity",
"type": "integer", "type": "integer",
"primaryKey": false, "primaryKey": false,
"notNull": true, "notNull": true,
@@ -974,6 +974,18 @@
"type": "text", "type": "text",
"primaryKey": false, "primaryKey": false,
"notNull": true "notNull": true
},
"resetPasswordToken": {
"name": "resetPasswordToken",
"type": "text",
"primaryKey": false,
"notNull": false
},
"resetPasswordExpiresAt": {
"name": "resetPasswordExpiresAt",
"type": "text",
"primaryKey": false,
"notNull": false
} }
}, },
"indexes": {}, "indexes": {},
@@ -3725,6 +3737,14 @@
"primaryKey": false, "primaryKey": false,
"notNull": true "notNull": true
}, },
"serverStatus": {
"name": "serverStatus",
"type": "serverStatus",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'active'"
},
"sshKeyId": { "sshKeyId": {
"name": "sshKeyId", "name": "sshKeyId",
"type": "text", "type": "text",
@@ -3917,6 +3937,14 @@
"gitlab", "gitlab",
"bitbucket" "bitbucket"
] ]
},
"public.serverStatus": {
"name": "serverStatus",
"schema": "public",
"values": [
"active",
"inactive"
]
} }
}, },
"schemas": {}, "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
+2 -23
View File
@@ -292,29 +292,8 @@
{ {
"idx": 41, "idx": 41,
"version": "6", "version": "6",
"when": 1729314952330, "when": 1729667438853,
"tag": "0041_small_aaron_stack", "tag": "0041_huge_bruce_banner",
"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",
"breakpoints": true "breakpoints": true
} }
] ]