made subregions unique to regions
All checks were successful
Vercel Production Deployment / Deploy-Production (push) Successful in 1m27s
All checks were successful
Vercel Production Deployment / Deploy-Production (push) Successful in 1m27s
This commit is contained in:
parent
14b14f9f26
commit
c90eedcabd
@ -82,11 +82,17 @@ export const winesRelations = relations(wines, ({ one }) => ({
|
|||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const subRegions = createTable("subRegion", {
|
export const subRegions = createTable(
|
||||||
|
"subRegion",
|
||||||
|
{
|
||||||
id: uuid("id").primaryKey().notNull().defaultRandom(),
|
id: uuid("id").primaryKey().notNull().defaultRandom(),
|
||||||
name: text("name").notNull().unique(),
|
name: text("name").notNull().unique(),
|
||||||
regionId: uuid("regionId").notNull(),
|
regionId: uuid("regionId").notNull(),
|
||||||
});
|
},
|
||||||
|
(t) => ({
|
||||||
|
uniqueSubRegion: unique().on(t.name, t.regionId),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
export const subRegionsRelations = relations(subRegions, ({ many, one }) => ({
|
export const subRegionsRelations = relations(subRegions, ({ many, one }) => ({
|
||||||
wines: many(wines),
|
wines: many(wines),
|
||||||
|
Loading…
Reference in New Issue
Block a user