(data): Start migration v7 -> v8.

This commit is contained in:
2022-01-10 18:55:00 +02:00
parent e6cbd31a23
commit 5fbf84537d
3 changed files with 20 additions and 2 deletions

View File

@@ -1,2 +1,2 @@
CONFIG_FILE = "config/bot.conf" CONFIG_FILE = "config/bot.conf"
DATA_VERSION = 7 DATA_VERSION = 8

View File

@@ -0,0 +1,18 @@
ALTER TABLE guild_config ADD COLUMN pomodoro_channel BIGINT;
-- Timer Data {{{
create TABLE timers(
channelid BIGINT PRIMARY KEY,
guildid BIGINT NOT NULL REFERENCES guild_config (guildid),
text_channelid BIGINT,
focus_length INTEGER NOT NULL,
break_length INTEGER NOT NULL,
last_started TIMESTAMPTZ NOT NULL,
inactivity_threshold INTEGER,
channel_name TEXT,
pretty_name TEXT
);
CREATE INDEX timers_guilds ON timers (guildid);
-- }}}
INSERT INTO VersionHistory (version, author) VALUES (8, 'v7-v8 migration');

View File

@@ -4,7 +4,7 @@ CREATE TABLE VersionHistory(
time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, time TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
author TEXT author TEXT
); );
INSERT INTO VersionHistory (version, author) VALUES (7, 'Initial Creation'); INSERT INTO VersionHistory (version, author) VALUES (8, 'Initial Creation');
CREATE OR REPLACE FUNCTION update_timestamp_column() CREATE OR REPLACE FUNCTION update_timestamp_column()