(data): Update version and migration.

This commit is contained in:
2021-12-07 13:23:13 +02:00
parent d95faed02b
commit b273ae0596
3 changed files with 11 additions and 9 deletions

View File

@@ -1,2 +1,2 @@
CONFIG_FILE = "config/bot.conf"
DATA_VERSION = 5
DATA_VERSION = 6

View File

@@ -1,16 +1,16 @@
DROP TYPE IF EXISTS SessionChannelType CASCADE;
DROP TABLE IF EXISTS session_history CASCADE;
DROP TABLE IF EXISTS current_sessions CASCADE;
DROP FUNCTION IF EXISTS close_study_session;
-- DROP TYPE IF EXISTS SessionChannelType CASCADE;
-- DROP TABLE IF EXISTS session_history CASCADE;
-- DROP TABLE IF EXISTS current_sessions CASCADE;
-- DROP FUNCTION IF EXISTS close_study_session(_guildid BIGINT, _userid BIGINT);
-- DROP FUNCTION IF EXISTS study_time_since(_guildid BIGINT, _userid BIGINT, _timestamp TIMESTAMPTZ)
-- DROP VIEW IF EXISTS current_sessions_totals CASCADE;
DROP VIEW IF EXISTS current_sessions_totals CASCADE;
DROP VIEW IF EXISTS member_totals CASCADE;
DROP VIEW IF EXISTS member_ranks CASCADE;
DROP VIEW IF EXISTS current_study_badges CASCADE;
DROP VIEW IF EXISTS new_study_badges CASCADE;
DROP FUNCTION IF EXISTS study_time_since;
CREATE TYPE SessionChannelType AS ENUM (
'STANDARD',
@@ -176,3 +176,5 @@ AS $$
$$ LANGUAGE PLPGSQL;
ALTER TABLE guild_config ADD COLUMN daily_study_cap INTEGER;
INSERT INTO VersionHistory (version, author) VALUES (6, 'v5-v6 Migration');

View File

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