Add company overview skeleton and cache
This commit is contained in:
@@ -607,6 +607,20 @@ export const companyFinancialBundle = sqliteTable('company_financial_bundle', {
|
||||
companyFinancialBundleTickerIndex: index('company_financial_bundle_ticker_idx').on(table.ticker, table.updated_at)
|
||||
}));
|
||||
|
||||
export const companyOverviewCache = sqliteTable('company_overview_cache', {
|
||||
id: integer('id').primaryKey({ autoIncrement: true }),
|
||||
user_id: text('user_id').notNull().references(() => user.id, { onDelete: 'cascade' }),
|
||||
ticker: text('ticker').notNull(),
|
||||
cache_version: integer('cache_version').notNull(),
|
||||
source_signature: text('source_signature').notNull(),
|
||||
payload: text('payload', { mode: 'json' }).$type<Record<string, unknown>>().notNull(),
|
||||
created_at: text('created_at').notNull(),
|
||||
updated_at: text('updated_at').notNull()
|
||||
}, (table) => ({
|
||||
companyOverviewCacheUnique: uniqueIndex('company_overview_cache_uidx').on(table.user_id, table.ticker),
|
||||
companyOverviewCacheLookupIndex: index('company_overview_cache_lookup_idx').on(table.user_id, table.ticker, table.updated_at)
|
||||
}));
|
||||
|
||||
export const filingLink = sqliteTable('filing_link', {
|
||||
id: integer('id').primaryKey({ autoIncrement: true }),
|
||||
filing_id: integer('filing_id').notNull().references(() => filing.id, { onDelete: 'cascade' }),
|
||||
@@ -831,6 +845,7 @@ export const appSchema = {
|
||||
filingTaxonomyFact,
|
||||
filingTaxonomyMetricValidation,
|
||||
companyFinancialBundle,
|
||||
companyOverviewCache,
|
||||
filingLink,
|
||||
taskRun,
|
||||
taskStageEvent,
|
||||
|
||||
Reference in New Issue
Block a user