fix: rename recycle_policy column to rotation_policy + migration
This commit is contained in:
@@ -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)]
|
#[derive(Debug, sqlx::FromRow)]
|
||||||
struct ChannelRow {
|
struct ChannelRow {
|
||||||
@@ -126,7 +126,7 @@ impl ChannelCommand for SqliteChannelRepository {
|
|||||||
sqlx::query(
|
sqlx::query(
|
||||||
r#"
|
r#"
|
||||||
INSERT INTO channels
|
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,
|
auto_schedule, access_mode, logo, logo_position,
|
||||||
logo_opacity, webhook_url, webhook_poll_interval_secs, webhook_body_template,
|
logo_opacity, webhook_url, webhook_poll_interval_secs, webhook_body_template,
|
||||||
webhook_headers, gap_filler, created_at, updated_at)
|
webhook_headers, gap_filler, created_at, updated_at)
|
||||||
@@ -136,7 +136,7 @@ impl ChannelCommand for SqliteChannelRepository {
|
|||||||
description = excluded.description,
|
description = excluded.description,
|
||||||
timezone = excluded.timezone,
|
timezone = excluded.timezone,
|
||||||
schedule_config = excluded.schedule_config,
|
schedule_config = excluded.schedule_config,
|
||||||
recycle_policy = excluded.recycle_policy,
|
rotation_policy = excluded.rotation_policy,
|
||||||
auto_schedule = excluded.auto_schedule,
|
auto_schedule = excluded.auto_schedule,
|
||||||
access_mode = excluded.access_mode,
|
access_mode = excluded.access_mode,
|
||||||
logo = excluded.logo,
|
logo = excluded.logo,
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE channels RENAME COLUMN recycle_policy TO rotation_policy;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE channels RENAME COLUMN recycle_policy TO rotation_policy;
|
||||||
Reference in New Issue
Block a user