gitdataai/lib/migrate/sql/repo/repo_commit_up_01.sql
2026-05-30 01:38:40 +08:00

14 lines
519 B
SQL

-- depends_on: repo_committer
CREATE TABLE IF NOT EXISTS repo_commit (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
repo UUID NOT NULL REFERENCES repo(id),
sha TEXT NOT NULL,
tree_sha TEXT NOT NULL,
parent_shas TEXT NOT NULL,
author UUID NOT NULL REFERENCES repo_committer(id),
committer UUID NOT NULL REFERENCES repo_committer(id),
message TEXT NOT NULL,
authored_at TIMESTAMPTZ NOT NULL,
committed_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);