diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-11-15 12:25:25 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-11-15 12:25:25 -0500 |
commit | 6296e97fafd4bb5063541bee83061c398f31d19e (patch) | |
tree | acf9622d16df7d53cd42b4df0bd88b9721f78f8e /server/migrations | |
parent | 4c0109a8c40012f75e3d0d900c0ef41893cfb4bb (diff) |
Add journaling trait for game objects
Diffstat (limited to 'server/migrations')
-rw-r--r-- | server/migrations/20221008120534_init.down.sql | 2 | ||||
-rw-r--r-- | server/migrations/20221008120534_init.up.sql | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/server/migrations/20221008120534_init.down.sql b/server/migrations/20221008120534_init.down.sql index 385537a..0c9bbed 100644 --- a/server/migrations/20221008120534_init.down.sql +++ b/server/migrations/20221008120534_init.down.sql @@ -2,6 +2,8 @@ begin; drop table if exists sessions; drop table if exists table_players; +drop table if exists table_journal; drop table if exists active_tables; drop table if exists players; +drop type if exists player_position; commit; diff --git a/server/migrations/20221008120534_init.up.sql b/server/migrations/20221008120534_init.up.sql index 8c53bb8..e4b9eb1 100644 --- a/server/migrations/20221008120534_init.up.sql +++ b/server/migrations/20221008120534_init.up.sql @@ -16,6 +16,13 @@ create table active_tables ( id uuid primary key not null ); +create table table_journal ( + table_id uuid references active_tables(id) not null, + seq bigint not null, + payload jsonb +); +create unique index journal_entry on table_journal (table_id, seq); + create type player_position as enum ('west', 'north', 'east', 'south'); create table table_players ( |