feat(25-01): add attribution columns and unique constraint to globalItems
- Add sourceUrl, imageCredit, imageSourceUrl nullable columns - Add unique constraint on (brand, model) pair - Generate migration 0003_loving_serpent_society.sql
This commit is contained in:
@@ -133,17 +133,24 @@ export const setupItems = pgTable("setup_items", {
|
||||
|
||||
// ── Global Items ────────────────────────────────────────────────────
|
||||
|
||||
export const globalItems = pgTable("global_items", {
|
||||
id: serial("id").primaryKey(),
|
||||
brand: text("brand").notNull(),
|
||||
model: text("model").notNull(),
|
||||
category: text("category"),
|
||||
weightGrams: doublePrecision("weight_grams"),
|
||||
priceCents: integer("price_cents"),
|
||||
imageUrl: text("image_url"),
|
||||
description: text("description"),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
});
|
||||
export const globalItems = pgTable(
|
||||
"global_items",
|
||||
{
|
||||
id: serial("id").primaryKey(),
|
||||
brand: text("brand").notNull(),
|
||||
model: text("model").notNull(),
|
||||
category: text("category"),
|
||||
weightGrams: doublePrecision("weight_grams"),
|
||||
priceCents: integer("price_cents"),
|
||||
imageUrl: text("image_url"),
|
||||
description: text("description"),
|
||||
sourceUrl: text("source_url"),
|
||||
imageCredit: text("image_credit"),
|
||||
imageSourceUrl: text("image_source_url"),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
},
|
||||
(table) => [unique().on(table.brand, table.model)],
|
||||
);
|
||||
|
||||
// ── Tags ───────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user