cs-prices: price history backfill (Steam daily median since 2013 from the public listing page, CSFloat daily averages, ECB FX history) in separate *-history streams; labelled on item charts
All checks were successful
Deploy production / deploy (push) Successful in 1m13s
All checks were successful
Deploy production / deploy (push) Successful in 1m13s
This commit is contained in:
@@ -185,3 +185,21 @@ export const csFxRates = csSchema.table('fx_rates', {
|
||||
day: date('day').primaryKey(),
|
||||
usdEur: numeric('usd_eur', { precision: 12, scale: 8 }).notNull()
|
||||
});
|
||||
|
||||
// Backfill bookkeeping (scripts/cs-history.ts): which config was fetched from which history
|
||||
// source, so the slow, throttled backfill can resume. History rows themselves live in
|
||||
// daily_prices under their own streams (kind ending in `-history`).
|
||||
export const csHistoryFetches = csSchema.table(
|
||||
'history_fetches',
|
||||
{
|
||||
itemId: integer('item_id')
|
||||
.notNull()
|
||||
.references(() => csMarketItems.id, { onDelete: 'cascade' }),
|
||||
source: text('source').notNull(),
|
||||
fetchedAt: timestamp('fetched_at', { withTimezone: true }).notNull().defaultNow(),
|
||||
points: integer('points').notNull().default(0),
|
||||
firstDay: date('first_day'),
|
||||
error: text('error')
|
||||
},
|
||||
(table) => [primaryKey({ name: 'history_fetches_pkey', columns: [table.itemId, table.source] })]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user