Files
mixmaker/backend/migrations/016_community_settings_and_stats.sql
lemintare fa4edc0df5
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / compose (push) Has been cancelled
Add player profiles and community settings
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-19 21:43:48 +03:00

21 lines
710 B
SQL

-- +mixmaker Up
CREATE TABLE community_settings (
singleton boolean PRIMARY KEY DEFAULT true CHECK (singleton),
discord_invite_url text NOT NULL DEFAULT '',
updated_at timestamptz NOT NULL DEFAULT now(),
updated_by text REFERENCES accounts(id)
);
INSERT INTO community_settings(singleton) VALUES (true)
ON CONFLICT(singleton) DO NOTHING;
CREATE INDEX IF NOT EXISTS series_event_id_idx
ON series ((body->>'eventId'));
CREATE INDEX IF NOT EXISTS events_completed_starts_at_idx
ON events (starts_at DESC) WHERE state = 'Completed';
-- +mixmaker Down
DROP INDEX IF EXISTS events_completed_starts_at_idx;
DROP INDEX IF EXISTS series_event_id_idx;
DROP TABLE IF EXISTS community_settings;