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 commits table
CREATE TABLE IF NOT EXISTS commits (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
author_id UUID NOT NULL REFERENCES users(id),
repo_id UUID NOT NULL REFERENCES repositories(id),
sha VARCHAR(40) NOT NULL,
message TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE(repo_id, sha)
);
-- Create indexes for better query performance
CREATE INDEX idx_commits_author_id ON commits(author_id);
CREATE INDEX idx_commits_repo_id ON commits(repo_id);
CREATE INDEX idx_commits_sha ON commits(sha);
CREATE INDEX idx_commits_created_at ON commits(created_at);