Mobile support to come.
..20260117042027_create_users.down.sql20260117042027_create_users.up.sql20260117043157_create_organizations.down.sql20260117043157_create_organizations.up.sql20260118222626_create_repositories.down.sql20260118222626_create_repositories.up.sql20260125182548_create_questions.down.sql20260125182548_create_questions.up.sql20260126215900_create_votes.down.sql20260126215900_create_votes.up.sql20260201050312_create_oauth.down.sql20260201050312_create_oauth.up.sql20260206190315_create_commits.down.sql20260206190315_create_commits.up.sql20260207120000_disable_auth_user_trigger.down.sql20260207120000_disable_auth_user_trigger.up.sql
CREATE TABLE IF NOT EXISTS votes (
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
target_id UUID NOT NULL,
value SMALLINT NOT NULL CHECK (value IN (-1, 1)),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY(user_id, target_id)
);
CREATE INDEX idx_votes_target_id ON votes(target_id);