diff --git a/shared/schema.ts b/shared/schema.ts index e29d94f..ab56fa4 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -62,6 +62,7 @@ export const dnsRecords = pgTable("dns_records", { isActive: boolean("is_active").default(true).notNull(), isAutoIP: boolean("is_auto_ip").default(false).notNull(), notes: text("notes"), + providerId: uuid("provider_id").references(() => providers.id, { onDelete: "set null" }), lastUpdated: timestamp("last_updated"), createdAt: timestamp("created_at").defaultNow().notNull(), }); @@ -375,6 +376,10 @@ export const dnsRecordsRelations = relations(dnsRecords, ({ one, many }) => ({ fields: [dnsRecords.domainId], references: [domains.id], }), + provider: one(providers, { + fields: [dnsRecords.providerId], + references: [providers.id], + }), history: many(dnsHistory), }));