Create table to store player preferences in teams

O01eg
May 14, 2023, 7:50 PM
5JDEJ6A4R5CHYKOT5UXOFZBQ7C7HRMGT6H5JYIXUBRQSNTAP6DAQC

Dependencies

  • [2] IXY6NZLM Start to use migrations files for PostgreSQL database

Change contents

  • file addition: 20230514_0_games-teamship-table.sql (----------)
    [2.15]
    -- Create table to store preferences of playmates
    -- Not attached to games, universal table
    CREATE TABLE IF NOT EXISTS auth.teamship (
    player_name CITEXT REFERENCES auth.users(player_name),
    other_player_name CITEXT REFERENCES auth.users(player_name),
    relationship BOOLEAN NOT NULL,
    CONSTRAINT pk_teamship PRIMARY KEY (player_name, other_player_name),
    CONSTRAINT chk_teamship CHECK (player_name <> other_player_name)
    );