From 157007544384b6bf1b9ddaa705d14ecf6920b01a Mon Sep 17 00:00:00 2001 From: Alessio Date: Sun, 25 Dec 2022 13:06:17 -0500 Subject: [PATCH] Add new spaces columns to the migrations --- build/build_dpkg.sh | 2 +- persistence/versions.go | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build/build_dpkg.sh b/build/build_dpkg.sh index 9f91442..19288f4 100755 --- a/build/build_dpkg.sh +++ b/build/build_dpkg.sh @@ -26,7 +26,7 @@ echo "Package: offline-twitter-engine Version: $1 Architecture: all Maintainer: me@playfulpachyderm.com -Installed-Size: 7700 +Installed-Size: 7998 Depends: Section: web Priority: optional diff --git a/persistence/versions.go b/persistence/versions.go index bc19510..98b1781 100644 --- a/persistence/versions.go +++ b/persistence/versions.go @@ -8,7 +8,7 @@ import ( "offline_twitter/terminal_utils" ) -const ENGINE_DATABASE_VERSION = 14 +const ENGINE_DATABASE_VERSION = 15 type VersionMismatchError struct { EngineVersion int @@ -80,6 +80,22 @@ var MIGRATIONS = []string{ create index if not exists index_polls_tweet_id on polls (tweet_id); create index if not exists index_images_tweet_id on images (tweet_id); create index if not exists index_videos_tweet_id on videos (tweet_id);`, + `alter table spaces add column created_by_id integer references users(id); + alter table spaces add column state text not null; + alter table spaces add column title text not null; + alter table spaces add column created_at integer not null; + alter table spaces add column started_at integer not null; + alter table spaces add column ended_at integer not null; + alter table spaces add column updated_at integer not null; + alter table spaces add column is_available_for_replay boolean not null; + alter table spaces add column replay_watch_count integer; + alter table spaces add column live_listeners_count integer; + alter table spaces add column is_details_fetched boolean not null default 0; + create table space_participants(rowid integer primary key, + user_id integer not null, + space_id not null, + foreign key(space_id) references spaces(id) + );`, } /**