From b8625b33df12578ccce28d1b0933b5a9abc29b33 Mon Sep 17 00:00:00 2001 From: Hiram <> Date: Sun, 1 Dec 2024 21:32:22 +0800 Subject: [PATCH] [change] table type length --- src/main/core/db/common/schema.ts | 2 +- src/main/core/db/migration/modules/update0_0_0to3_3_1.ts | 2 +- src/main/core/db/migration/modules/update3_3_8to3_3_9.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/core/db/common/schema.ts b/src/main/core/db/common/schema.ts index 179c90fb8..27bb5fd42 100644 --- a/src/main/core/db/common/schema.ts +++ b/src/main/core/db/common/schema.ts @@ -35,7 +35,7 @@ const iptv = pgTable('iptv', { const channel = pgTable('channel', { id: uuid().defaultRandom(), name: varchar('name', { length: 255 }), - url: varchar('url', { length: 255 }), + url: varchar('url', { length: 510 }), group: varchar('group', { length: 255 }), }); diff --git a/src/main/core/db/migration/modules/update0_0_0to3_3_1.ts b/src/main/core/db/migration/modules/update0_0_0to3_3_1.ts index f93861dfc..f8c4fce28 100644 --- a/src/main/core/db/migration/modules/update0_0_0to3_3_1.ts +++ b/src/main/core/db/migration/modules/update0_0_0to3_3_1.ts @@ -38,7 +38,7 @@ const update = async () => { CREATE TABLE IF NOT EXISTS tbl_channel ( id uuid DEFAULT gen_random_uuid(), name varchar(255) not null, - url varchar(255) not null, + url varchar(510) not null, "group" varchar(255) ); diff --git a/src/main/core/db/migration/modules/update3_3_8to3_3_9.ts b/src/main/core/db/migration/modules/update3_3_8to3_3_9.ts index 558d5238a..63a708f76 100644 --- a/src/main/core/db/migration/modules/update3_3_8to3_3_9.ts +++ b/src/main/core/db/migration/modules/update3_3_8to3_3_9.ts @@ -10,6 +10,8 @@ const update = async () => { ALTER TABLE tbl_site rename search_new to search; ALTER TABLE tbl_drive ADD COLUMN "showAll" boolean default false; + + ALTER TABLE tbl_channel ALTER COLUMN url TYPE varchar(510); `); const old_version = await db.select().from(schema.setting).where(eq(schema.setting.key, 'version'));