Bug: unknown column-type / onDelete tokens silently fall back to Text / NoAction (no validation) — typos corrupt the schema
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 65/100
Hướng nghiên cứu
Start in Migration/Nimblesite.DataProvider.Migration.Core/SchemaYamlSerializer.cs, reading ParseType(...) and ForeignKeyActionYamlConverter.ReadYaml(...), where unknown tokens currently fall back silently. Trace how parse failures or warnings are reported, then verify that invalid type and onDelete tokens name the offending value and do not produce a successful migration with Text or NoAction.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Unrecognized type: and onDelete: tokens in a schema YAML are silently coerced to Text / NoAction with no error or warning. A typo therefore produces a silently-wrong schema that still "migrates successfully" and passes the post-apply integrity check (because both the desired and actual sides agree on the wrong type).
Environment
- v0.9.12-beta (commit
8e3af36)
Details
In Migration/Nimblesite.DataProvider.Migration.Core/SchemaYamlSerializer.cs:
ParseType(...)ends both the parameterized and the simple switch with_ => new TextType()(≈ lines 221 and 249).ForeignKeyActionYamlConverter.ReadYaml(...)ends with_ => ForeignKeyAction.NoAction(≈ line 302).
Repro
- { name: id, type: Uuidd, isNullable: false } # typo -> column created as TEXT, no error
foreignKeys:
- { columns: [parent_id], referencedTable: t, referencedColumns: [id], onDelete: Cascadee } # typo -> NO ACTION
migrate reports success and the integrity check passes, but id is text (not uuid) and the FK is NO ACTION (not CASCADE).
Impact
Silent schema corruption from a single-character typo: a uuid/json/timestamptz column quietly becomes text; a cascade/set-null FK quietly becomes no-action. The "integrity check passed" message gives false confidence.
Suggested fix
Reject an unrecognized token (return a MigrationError / throw a parse error), or at minimum emit a loud warn log naming the offending token and column. Defaulting to Text/NoAction should never be silent.
- Ngôn ngữ chính
- C#
- Star
- 68
- Fork
- 4
- Merge trung bình
- 50 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Nimblesite/DataProvider
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 92/100
Nimblesite/DataProvider#137 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Nimblesite/DataProvider#72 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Nimblesite/DataProvider#121 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Nimblesite/DataProvider#108 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A check constraint the schema cannot name can never be retired, and keeps enforcing the old ruleĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Nimblesite/DataProvider#107 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Nimblesite/DataProvider
Issue tương tự
-
kronos:develop:queued priority:P0
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nopSolutions/nopCommerce#8512 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
modelcontextprotocol/csharp-sdk#2061 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày