Add field to store timestamp of joining game

O01eg
May 9, 2023, 11:18 AM
ZQIIC7C3GKGW5G5LHOEEVJQH5HR2RJAN5C67Y4LFFBFFZTKNRXIAC

Dependencies

  • [2] MUTHALNP Detect user and domain in Mastodon fediverse
  • [*] FUCFD4UV Add log in and log out support
  • [*] IXY6NZLM Start to use migrations files for PostgreSQL database

Change contents

  • edit in src/pages/log_in.rs at line 201
    [2.1725]
    [2.1725]
    // Try to register on Mastodon
  • file addition: 20230509_0_game-player-create_ts.sql (----------)
    [5.15]
    -- Add field to store timestamp of joining game
    DO $$
    BEGIN
    IF NOT EXISTS (
    SELECT 1 FROM pg_class c
    INNER JOIN pg_namespace n ON n.oid = c.relnamespace
    INNER JOIN pg_attribute a ON a.attrelid = c.oid
    WHERE c.relname = 'players' AND n.nspname = 'games' AND a.attname = 'create_ts'
    ) THEN
    ALTER TABLE games.players ADD COLUMN create_ts TIMESTAMP WITHOUT TIME ZONE NULL;
    END IF;
    END
    $$;