AddColumn with inline checkConstraint on an existing table double-applies the constraint (42710)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
調査の方向性
Read the planner, AddColumnOperation, and AddCheckConstraintOperation, then reproduce the existing-table migration using the declarative schema example in the issue. Done means the new column is applied successfully, its check constraint is present once, and rerunning the migration does not fail with PostgreSQL error 42710.
索引モデルが issue の本文から書いたものです。
説明
What happened
DataProviderMigrate (postgres, additive phase) over a declarative schema where an existing table gains one new column that carries a checkConstraint:
- name: workspace_size
type: Text
checkConstraint: "workspace_size IS NULL OR workspace_size IN ('small','medium','large')"
Plan and outcome:
Phase: all — applying 2 of 2 operation(s):
AddColumnOperation
AddCheckConstraintOperation
Error: migration apply failed: 42710: constraint "agent_configs_workspace_size_chk" for relation "agent_configs" already exists
The whole apply rolls back, so the column never lands: information_schema.columns and pg_constraint both show nothing afterwards, and every re-run fails the same way.
Diagnosis
AddColumnOperation already emits the column-level CHECK (named <table>_<column>_chk), and the planner also schedules a separate AddCheckConstraintOperation for the same declaration with the same name. On a fresh CREATE TABLE this does not happen, which is why the same YAML pattern works for columns declared at table-creation time.
Expected
One of:
- the planner emits only
AddColumnOperation(with the inline check) when the column is new, or AddColumnOperationemits the bare column and leaves the check toAddCheckConstraintOperation.
Environment
- Postgres 17 (Supabase)
- Provider: postgres
- Consumer: Nimblesite/NimblesiteAgenticPlatform
migrations/schema.yaml, tableagent_configs
- 主要言語
- C#
- スター
- 68
- フォーク
- 4
- 平均マージ
- 36分
- マージ済み PR(30日)
- 9
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Nimblesite/DataProvider のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Nimblesite/DataProvider#72 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Nimblesite/DataProvider#121 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Nimblesite/DataProvider#108 ·
メンテナーはふだん 1 日以内に返信
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Nimblesite/DataProvider#107 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
Nimblesite/DataProvider#106 ·
メンテナーはふだん 1 日以内に返信
Nimblesite/DataProvider の issue をすべて見る
似ている issue
-
area-multitenancy area-security p1-recommended priority-high technical-debt
難易度 2/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
kind/enhancement Provider Upgrade pulumi/pulumi-azure R1 Task
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
pulumi/pulumi-azure#3669 ·
-
[BUG] FromCString causes 1 byte OOB read in native code対応中かも @mattleibow が 1 日前に担当しました。 オープンtype/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mono/SkiaSharp#5426 · リアクション 1 件 · 担当者 2 名 ·
メンテナーはふだん 1 日以内に返信
-
webclient does not start対応中かも @PawelTroka が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PawelTroka/Computator.NET#257 ·
メンテナーはふだん 1 日以内に返信