CREATE TABLE IF NOT EXISTS repo_release_asset (
    id UUID PRIMARY KEY,
    release_id UUID NOT NULL REFERENCES repo_release(id) ON DELETE CASCADE,
    name TEXT NOT NULL,
    content_type TEXT,
    size BIGINT NOT NULL DEFAULT 0,
    download_count BIGINT NOT NULL DEFAULT 0,
    storage_path TEXT NOT NULL,
    uploader UUID NOT NULL REFERENCES "user"(id),
    created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_release_asset_release ON repo_release_asset(release_id);
