summaryrefslogtreecommitdiff
path: root/server/migrations
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-11-15 14:14:02 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-11-15 14:14:02 -0500
commit8fa1b37bb705371bf5dee574f1f136019d3db9d1 (patch)
treeaabc46d6727a395f93badef0011ee165ab2cf6f0 /server/migrations
parent6296e97fafd4bb5063541bee83061c398f31d19e (diff)
Implement DbJournal
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/20221008120534_init.down.sql2
-rw-r--r--server/migrations/20221008120534_init.up.sql8
2 files changed, 5 insertions, 5 deletions
diff --git a/server/migrations/20221008120534_init.down.sql b/server/migrations/20221008120534_init.down.sql
index 0c9bbed..50ba511 100644
--- a/server/migrations/20221008120534_init.down.sql
+++ b/server/migrations/20221008120534_init.down.sql
@@ -2,7 +2,7 @@
begin;
drop table if exists sessions;
drop table if exists table_players;
-drop table if exists table_journal;
+drop table if exists object_journal;
drop table if exists active_tables;
drop table if exists players;
drop type if exists player_position;
diff --git a/server/migrations/20221008120534_init.up.sql b/server/migrations/20221008120534_init.up.sql
index e4b9eb1..db9fd3c 100644
--- a/server/migrations/20221008120534_init.up.sql
+++ b/server/migrations/20221008120534_init.up.sql
@@ -16,12 +16,12 @@ create table active_tables (
id uuid primary key not null
);
-create table table_journal (
- table_id uuid references active_tables(id) not null,
+create table object_journal (
+ id uuid not null,
seq bigint not null,
- payload jsonb
+ payload jsonb not null
);
-create unique index journal_entry on table_journal (table_id, seq);
+create unique index journal_entry on object_journal (id, seq);
create type player_position as enum ('west', 'north', 'east', 'south');