mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-09 01:16:15 -08:00
schema.ts grew past the 400-line lint budget with the manual EPG-to-channel mapping table (#1165), which breaks lint for every PR. Move the mapping table and its types into epg-mapping.schema.ts and re-export them from schema.ts so the schema namespace and all existing imports stay unchanged.
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
/**
|
|
* Drizzle ORM schema for manual EPG-to-channel mappings.
|
|
*
|
|
* Split out of schema.ts to keep that file within the repository's
|
|
* max-lines budget; re-exported from there so `import * as schema`
|
|
* consumers keep seeing a single schema namespace.
|
|
*/
|
|
|
|
import { sql } from 'drizzle-orm';
|
|
import { index, integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
|
|
// EPG channel mappings (manual user overrides)
|
|
export const epgChannelMappings = sqliteTable(
|
|
'epg_channel_mappings',
|
|
{
|
|
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
channelKey: text('channel_key').notNull().unique(),
|
|
epgChannelId: text('epg_channel_id').notNull(),
|
|
playlistId: text('playlist_id'),
|
|
updatedAt: text('updated_at').default(sql`CURRENT_TIMESTAMP`),
|
|
},
|
|
(table) => ({
|
|
playlistIdx: index('idx_epg_channel_mappings_playlist').on(
|
|
table.playlistId
|
|
),
|
|
})
|
|
);
|
|
|
|
export type EpgChannelMapping = typeof epgChannelMappings.$inferSelect;
|
|
export type NewEpgChannelMapping = typeof epgChannelMappings.$inferInsert;
|