From 25ff9d2779f7c65e76207142aa23eb9044e18773 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 12 Jul 2026 15:29:50 +0200 Subject: [PATCH] fix: rename recycle_policy column to rotation_policy + migration --- crates/adapters/sqlite/src/channel.rs | 6 +++--- .../20260712000004_rename_recycle_to_rotation_policy.sql | 1 + .../20260712000004_rename_recycle_to_rotation_policy.sql | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 k-tv-backend/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql create mode 100644 migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql diff --git a/crates/adapters/sqlite/src/channel.rs b/crates/adapters/sqlite/src/channel.rs index 93d133b..5aae7ca 100644 --- a/crates/adapters/sqlite/src/channel.rs +++ b/crates/adapters/sqlite/src/channel.rs @@ -23,7 +23,7 @@ impl SqliteChannelRepository { } } -const SELECT_COLS: &str = "id, owner_id, name, description, timezone, schedule_config, recycle_policy AS rotation_policy, auto_schedule, access_mode, logo, logo_position, logo_opacity, webhook_url, webhook_poll_interval_secs, webhook_body_template, webhook_headers, gap_filler, created_at, updated_at"; +const SELECT_COLS: &str = "id, owner_id, name, description, timezone, schedule_config, rotation_policy, auto_schedule, access_mode, logo, logo_position, logo_opacity, webhook_url, webhook_poll_interval_secs, webhook_body_template, webhook_headers, gap_filler, created_at, updated_at"; #[derive(Debug, sqlx::FromRow)] struct ChannelRow { @@ -126,7 +126,7 @@ impl ChannelCommand for SqliteChannelRepository { sqlx::query( r#" INSERT INTO channels - (id, owner_id, name, description, timezone, schedule_config, recycle_policy, + (id, owner_id, name, description, timezone, schedule_config, rotation_policy, auto_schedule, access_mode, logo, logo_position, logo_opacity, webhook_url, webhook_poll_interval_secs, webhook_body_template, webhook_headers, gap_filler, created_at, updated_at) @@ -136,7 +136,7 @@ impl ChannelCommand for SqliteChannelRepository { description = excluded.description, timezone = excluded.timezone, schedule_config = excluded.schedule_config, - recycle_policy = excluded.recycle_policy, + rotation_policy = excluded.rotation_policy, auto_schedule = excluded.auto_schedule, access_mode = excluded.access_mode, logo = excluded.logo, diff --git a/k-tv-backend/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql b/k-tv-backend/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql new file mode 100644 index 0000000..17613e7 --- /dev/null +++ b/k-tv-backend/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql @@ -0,0 +1 @@ +ALTER TABLE channels RENAME COLUMN recycle_policy TO rotation_policy; diff --git a/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql b/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql new file mode 100644 index 0000000..17613e7 --- /dev/null +++ b/migrations_sqlite/20260712000004_rename_recycle_to_rotation_policy.sql @@ -0,0 +1 @@ +ALTER TABLE channels RENAME COLUMN recycle_policy TO rotation_policy;