Deprecated pgTable signature

I'm seeing this as deprecated, but not clear on what the correct / up to date usage should be:
export const providerServiceAreas = pgTable(
"provider_service_areas",
{
providerId: uuid("provider_id")
.notNull()
.references(() => providers.id, { onDelete: "cascade" }), // Foreign key to providers
serviceAreaId: uuid("service_area_id")
.notNull()
.references(() => serviceAreas.id, { onDelete: "cascade" }), // Foreign key to service areas
},
(t) => ({
pk: primaryKey({ columns: [t.providerId, t.serviceAreaId] }), // Composite primary key for uniqueness
})
);
export const providerServiceAreas = pgTable(
"provider_service_areas",
{
providerId: uuid("provider_id")
.notNull()
.references(() => providers.id, { onDelete: "cascade" }), // Foreign key to providers
serviceAreaId: uuid("service_area_id")
.notNull()
.references(() => serviceAreas.id, { onDelete: "cascade" }), // Foreign key to service areas
},
(t) => ({
pk: primaryKey({ columns: [t.providerId, t.serviceAreaId] }), // Composite primary key for uniqueness
})
);
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server