-- Create table to store client_id and client_secret for mastodon instances

CREATE TABLE IF NOT EXISTS auth.mastodon_apps (
 domain VARCHAR(100) NOT NULL,
 refresh_ts TIMESTAMP WITHOUT TIME ZONE NOT NULL,
 client_id VARCHAR(255) NULL,
 client_secret VARCHAR(255) NULL,
 CONSTRAINT pk_domain PRIMARY KEY (domain)
);

GRANT SELECT, INSERT, UPDATE ON auth.mastodon_apps TO freeorion_test;