mirror of
https://github.com/outbackdingo/pangolin.git
synced 2026-01-27 10:20:03 +00:00
Add blueprints to migrations
This commit is contained in:
@@ -79,6 +79,21 @@ export default async function migration() {
|
||||
);
|
||||
`);
|
||||
|
||||
await db.execute(sql`
|
||||
CREATE TABLE "blueprints" (
|
||||
"blueprintId" serial PRIMARY KEY NOT NULL,
|
||||
"orgId" text NOT NULL,
|
||||
"name" varchar NOT NULL,
|
||||
"source" varchar NOT NULL,
|
||||
"createdAt" integer NOT NULL,
|
||||
"succeeded" boolean NOT NULL,
|
||||
"contents" text NOT NULL,
|
||||
"message" text
|
||||
);
|
||||
`);
|
||||
|
||||
await db.execute(sql`ALTER TABLE "blueprints" ADD CONSTRAINT "blueprints_orgId_orgs_orgId_fk" FOREIGN KEY ("orgId") REFERENCES "public"."orgs"("orgId") ON DELETE cascade ON UPDATE no action;`);
|
||||
|
||||
await db.execute(sql`ALTER TABLE "resources" DROP CONSTRAINT "resources_skipToIdpId_idp_idpId_fk";`);
|
||||
await db.execute(sql`ALTER TABLE "domains" ADD COLUMN "certResolver" varchar;`);
|
||||
await db.execute(sql`ALTER TABLE "domains" ADD COLUMN "customCertResolver" varchar;`);
|
||||
|
||||
@@ -112,6 +112,23 @@ export default async function migration() {
|
||||
`
|
||||
).run();
|
||||
|
||||
|
||||
db.prepare(
|
||||
`
|
||||
CREATE TABLE 'blueprints' (
|
||||
'blueprintId' integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
'orgId' text NOT NULL,
|
||||
'name' text NOT NULL,
|
||||
'source' text NOT NULL,
|
||||
'createdAt' integer NOT NULL,
|
||||
'succeeded' integer NOT NULL,
|
||||
'contents' text NOT NULL,
|
||||
'message' text,
|
||||
FOREIGN KEY ('orgId') REFERENCES 'orgs'('orgId') ON UPDATE no action ON DELETE cascade
|
||||
);
|
||||
`
|
||||
).run();
|
||||
|
||||
db.prepare(
|
||||
`CREATE INDEX 'idx_requestAuditLog_timestamp' ON 'requestAuditLog' ('timestamp');`
|
||||
).run();
|
||||
|
||||
Reference in New Issue
Block a user