From 88366acba07b678466b42829887dcdda4f583686 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 31 Dec 2022 12:17:35 -0500 Subject: Add database conversion for bridge types --- server/migrations/20221008120534_init.down.sql | 2 ++ server/migrations/20221008120534_init.up.sql | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'server/migrations') diff --git a/server/migrations/20221008120534_init.down.sql b/server/migrations/20221008120534_init.down.sql index 50ba511..3bff171 100644 --- a/server/migrations/20221008120534_init.down.sql +++ b/server/migrations/20221008120534_init.down.sql @@ -6,4 +6,6 @@ drop table if exists object_journal; drop table if exists active_tables; drop table if exists players; drop type if exists player_position; +drop type if exists suit; +drop domain if exists rank; commit; diff --git a/server/migrations/20221008120534_init.up.sql b/server/migrations/20221008120534_init.up.sql index db9fd3c..05b7697 100644 --- a/server/migrations/20221008120534_init.up.sql +++ b/server/migrations/20221008120534_init.up.sql @@ -16,6 +16,11 @@ create table active_tables ( id uuid primary key not null ); +create type player_position as enum ('west', 'north', 'east', 'south'); +create type suit as enum ('club', 'diamond', 'heart', 'spade'); +create domain rank smallint check (value between 2 and 14); + +-- TODO: Remove this. create table object_journal ( id uuid not null, seq bigint not null, @@ -23,8 +28,6 @@ create table object_journal ( ); create unique index journal_entry on object_journal (id, seq); -create type player_position as enum ('west', 'north', 'east', 'south'); - create table table_players ( active_tables_id uuid not null references active_tables (id), player_id varchar(64) not null references players (id), -- cgit v1.2.3