[chore] schema for price history

This commit is contained in:
2026-03-09 15:43:37 -04:00
parent 7482cb9e9c
commit 1089bcdc20
2 changed files with 16 additions and 0 deletions

View File

@@ -97,6 +97,15 @@ export const skus = mysqlTable("skus", {
index("productIdIdx").on(table.productId, table.variant),
]);
export const priceHistory = mysqlTable("price_history", {
skuId: int().default(0).notNull(),
calculatedAt: datetime(),
marketPrice: decimal({ precision: 10, scale: 2 }),
},
(table) => [
index("idx_price_history").on(table.skuId, table.calculatedAt),
]);
export const processingSkus = mysqlTable("processingSkus", {
skuId: int().primaryKey(),
});