🐛 add missing orgId to blueprints table

This commit is contained in:
Fred KISSIE
2025-10-29 14:39:42 +01:00
parent 69458ab649
commit 39b3b4ef9d

View File

@@ -25,7 +25,6 @@ export const domains = pgTable("domains", {
preferWildcardCert: boolean("preferWildcardCert")
});
export const dnsRecords = pgTable("dnsRecords", {
id: serial("id").primaryKey(),
domainId: varchar("domainId")
@@ -34,7 +33,7 @@ export const dnsRecords = pgTable("dnsRecords", {
recordType: varchar("recordType").notNull(), // "NS" | "CNAME" | "A" | "TXT"
baseDomain: varchar("baseDomain"),
value: varchar("value").notNull(),
verified: boolean("verified").notNull().default(false),
verified: boolean("verified").notNull().default(false)
});
export const orgs = pgTable("orgs", {
@@ -706,6 +705,11 @@ export const setupTokens = pgTable("setupTokens", {
// Blueprint runs
export const blueprints = pgTable("blueprints", {
blueprintId: serial("blueprintId").primaryKey(),
orgId: text("orgId")
.references(() => orgs.orgId, {
onDelete: "cascade"
})
.notNull(),
name: varchar("name").notNull(),
source: varchar("source").notNull(),
createdAt: integer("createdAt").notNull(),