[chore] move inventory relationship to sku

This commit is contained in:
2026-04-07 09:52:17 -04:00
parent 5dc7ce2de7
commit cb829e1922
4 changed files with 34 additions and 31 deletions

View File

@@ -129,15 +129,14 @@ export const inventory = pokeSchema.table('inventory',{
inventoryId: uuid().primaryKey().notNull().defaultRandom(),
userId: varchar({ length: 100 }).notNull(),
catalogName: varchar({ length: 100 }),
cardId: integer().notNull(),
condition: varchar({ length: 255 }).notNull(),
skuId: integer().notNull(),
quantity: integer(),
purchasePrice: decimal({ precision: 10, scale: 2 }),
note: varchar({ length:255 }),
createdAt: timestamp().notNull().defaultNow(),
},
(table) => [
index('idx_userid_cardid').on(table.userId, table.cardId)
index('idx_userid_skuId').on(table.userId, table.skuId)
]);
export const processingSkus = pokeSchema.table('processing_skus', {