mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 06:06:18 -08:00
fix(epg): preserve source metadata through cache cleanup
This commit is contained in:
1 parent
6d406c85e2
commit
dc0b7581cb
16 files changed
+514
-59
No files matched your search
@@ -11,6 +11,7 @@ import { sql } from 'drizzle-orm';
|
||||
import {
|
||||
index,
|
||||
integer,
|
||||
primaryKey,
|
||||
sqliteTable,
|
||||
text,
|
||||
uniqueIndex,
|
||||
@@ -204,6 +205,25 @@ export const epgChannels = sqliteTable(
|
||||
})
|
||||
);
|
||||
|
||||
// A global XMLTV ID can be shared by sources with different channel metadata.
|
||||
export const epgChannelSources = sqliteTable(
|
||||
'epg_channel_sources',
|
||||
{
|
||||
channelId: text('channel_id')
|
||||
.notNull()
|
||||
.references(() => epgChannels.id, { onDelete: 'cascade' }),
|
||||
sourceUrl: text('source_url').notNull(),
|
||||
displayName: text('display_name').notNull(),
|
||||
iconUrl: text('icon_url'),
|
||||
url: text('url'),
|
||||
updatedAt: text('updated_at').default(sql`CURRENT_TIMESTAMP`),
|
||||
},
|
||||
(table) => [
|
||||
primaryKey({ columns: [table.channelId, table.sourceUrl] }),
|
||||
index('idx_epg_channel_sources_source').on(table.sourceUrl),
|
||||
]
|
||||
);
|
||||
|
||||
// EPG Programs table
|
||||
export const epgPrograms = sqliteTable(
|
||||
'epg_programs',
|
||||
|
||||
Reference in new issue
Block a user