mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-15 20:25:23 +02:00
feat(database): add managed_server table and associated constraints
- Introduced a new SQL migration file "0167_dizzy_solo.sql" to create the "managed_server" table with relevant columns and a custom ENUM type for server status. - Added foreign key constraints linking "organizationId" to the "organization" table and "serverId" to the "server" table, enhancing data integrity. - Updated journal and snapshot metadata to reflect the new migration.
This commit is contained in:
22
apps/dokploy/drizzle/0167_dizzy_solo.sql
Normal file
22
apps/dokploy/drizzle/0167_dizzy_solo.sql
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
CREATE TYPE "public"."managedServerStatus" AS ENUM('pending', 'provisioning', 'configuring', 'ready', 'error', 'terminating', 'terminated');--> statement-breakpoint
|
||||||
|
CREATE TABLE "managed_server" (
|
||||||
|
"managedServerId" text PRIMARY KEY NOT NULL,
|
||||||
|
"organizationId" text NOT NULL,
|
||||||
|
"serverId" text,
|
||||||
|
"plan" text NOT NULL,
|
||||||
|
"status" "managedServerStatus" DEFAULT 'pending' NOT NULL,
|
||||||
|
"hostingerVmId" integer,
|
||||||
|
"hostingerSubscriptionId" text,
|
||||||
|
"dataCenterId" integer NOT NULL,
|
||||||
|
"ipAddress" text,
|
||||||
|
"hostname" text,
|
||||||
|
"stripeSubscriptionId" text,
|
||||||
|
"stripePriceId" text,
|
||||||
|
"rootPassword" text,
|
||||||
|
"errorMessage" text,
|
||||||
|
"createdAt" text NOT NULL,
|
||||||
|
"updatedAt" text NOT NULL
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "managed_server" ADD CONSTRAINT "managed_server_organizationId_organization_id_fk" FOREIGN KEY ("organizationId") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "managed_server" ADD CONSTRAINT "managed_server_serverId_server_serverId_fk" FOREIGN KEY ("serverId") REFERENCES "public"."server"("serverId") ON DELETE set null ON UPDATE no action;
|
||||||
8469
apps/dokploy/drizzle/meta/0167_snapshot.json
Normal file
8469
apps/dokploy/drizzle/meta/0167_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1170,6 +1170,13 @@
|
|||||||
"when": 1778303519111,
|
"when": 1778303519111,
|
||||||
"tag": "0166_nosy_slapstick",
|
"tag": "0166_nosy_slapstick",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 167,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1778657133470,
|
||||||
|
"tag": "0167_dizzy_solo",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user