-- Add table to store tokens to reset password

CREATE TABLE IF NOT EXISTS auth.reset_tokens (
 player_name CITEXT REFERENCES auth.users(player_name) PRIMARY KEY,
 token UUID NOT NULL,
 ip_address TEXT NULL,
 create_ts TIMESTAMP WITHOUT TIME ZONE NOT NULL,
 last_error TEXT NULL,
 UNIQUE(token)
);
GRANT SELECT, INSERT, UPDATE, DELETE ON auth.reset_tokens TO freeorion;