Skip to content

add constraint to repo_mode#70

Merged
vigo merged 1 commit intomainfrom
fix-migration
Mar 19, 2026
Merged

add constraint to repo_mode#70
vigo merged 1 commit intomainfrom
fix-migration

Conversation

@vigo
Copy link
Contributor

@vigo vigo commented Mar 19, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 18:09
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dabb2ae303

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"created_at" TIMESTAMP NOT NULL DEFAULT (NOW() AT TIME ZONE 'UTC'),
"admin_user_id" BIGINT REFERENCES "cauldron"."app_user"(id),
"repo_mode" VARCHAR(10) DEFAULT 'all',
"repo_mode" VARCHAR(10) NOT NULL DEFAULT 'all' CHECK (repo_mode IN ('all', 'selected')),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Ship this constraint in a new migration

For databases that have already applied version 11, changing 000011_github_org_settings.up.sql is a no-op: cmd/migrator/main.go:19-24 only calls m.Up(), so previously recorded migrations are not re-run. In other words, every existing deployment that already created cauldron.github_org_settings will continue accepting NULL or unsupported repo_mode values, and only fresh installs get the new constraint. This needs to be an ALTER TABLE in a new numbered migration if the goal is to harden upgraded environments too.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds stronger data integrity constraints to the cauldron.github_org_settings.repo_mode column so only supported modes are persisted.

Changes:

  • Make repo_mode NOT NULL with default 'all'.
  • Add a CHECK constraint restricting repo_mode to ('all', 'selected').

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"created_at" TIMESTAMP NOT NULL DEFAULT (NOW() AT TIME ZONE 'UTC'),
"admin_user_id" BIGINT REFERENCES "cauldron"."app_user"(id),
"repo_mode" VARCHAR(10) DEFAULT 'all',
"repo_mode" VARCHAR(10) NOT NULL DEFAULT 'all' CHECK (repo_mode IN ('all', 'selected')),
@vigo vigo merged commit 551ff5f into main Mar 19, 2026
4 checks passed
@vigo vigo deleted the fix-migration branch March 19, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants