From 8fa1b37bb705371bf5dee574f1f136019d3db9d1 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 15 Nov 2022 14:14:02 -0500 Subject: Implement DbJournal --- server/migrations/20221008120534_init.down.sql | 2 +- server/migrations/20221008120534_init.up.sql | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/migrations') 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'); -- cgit v1.2.3