Add field to choose password type to reset

O01eg
Sep 16, 2022, 6:40 PM
3V4HG2HRWMVGMWHSZRG6CCJPRSTNL4PHDXLGFS2ZPYSO3ABSZ3BAC

Dependencies

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

Change contents

  • file addition: 20220916_0_reset-password-type.sql (----------)
    [2.15]
    -- Add field to choose password type to reset
    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 = 'reset_tokens' AND n.nspname = 'auth' AND a.attname = 'is_game_pwd'
    ) THEN
    ALTER TABLE auth.reset_tokens ADD COLUMN is_game_pwd BOOLEAN NOT NULL DEFAULT TRUE;
    END IF;
    END
    $$;