-
Notifications
You must be signed in to change notification settings - Fork 0
demo(dist3): VG007 VG008 and VG101-VG105 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Dist 3: VG007, VG008, VG101-VG105 | ||
|
|
||
| This demo bundle intentionally triggers: | ||
|
|
||
| - VG007 (destructive DDL) | ||
| - VG008 (non-concurrent index) | ||
| - VG101 (model column missing in migration) | ||
| - VG102 (required migration column missing in model) | ||
| - VG103 (model/migration type mismatch) | ||
| - VG104 (explicit model table not found) | ||
| - VG105 (unknown projection column) | ||
|
|
||
| Coverage in this bundle: | ||
|
|
||
| - SQL migrations and SQL queries | ||
| - Python ORM models (schema drift) | ||
| - Python non-ORM query execution |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| from sqlalchemy import Column, Integer, String | ||
| from sqlalchemy.orm import DeclarativeBase | ||
|
|
||
|
|
||
| class Base(DeclarativeBase): | ||
| pass | ||
|
|
||
|
|
||
| class VG101User(Base): | ||
| __tablename__ = "vg101_users" | ||
|
|
||
| id = Column(Integer, primary_key=True) | ||
| ghost_col = Column(String(64)) | ||
|
|
||
|
|
||
| class VG102Account(Base): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| __tablename__ = "vg102_accounts" | ||
|
|
||
| id = Column(Integer, primary_key=True) | ||
|
|
||
|
|
||
| class VG103Order(Base): | ||
| __tablename__ = "vg103_orders" | ||
|
|
||
| id = Column(Integer, primary_key=True) | ||
| total = Column(String(32)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
|
|
||
| class VG104AuditEvent(Base): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [valk-guard] reported by reviewdog 🐶 |
||
| __tablename__ = "vg104_audit_events" | ||
|
|
||
| id = Column(Integer, primary_key=True) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| from sqlalchemy import text | ||
| from sqlalchemy.orm import Session | ||
|
|
||
|
|
||
| def raw_unknown_projection_column(session: Session): | ||
| return session.execute(text("SELECT vg105_users.ghost_col FROM vg105_users LIMIT 1")).all() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [valk-guard] reported by reviewdog 🐶 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| DROP TABLE vg101_users; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [valk-guard] reported by reviewdog 🐶 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| CREATE INDEX idx_vg105_users_email_bad ON vg105_users(email); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| CREATE TABLE vg101_users ( | ||
| id INTEGER PRIMARY KEY | ||
| ); | ||
|
|
||
| CREATE TABLE vg102_accounts ( | ||
| id INTEGER PRIMARY KEY, | ||
| required_code TEXT NOT NULL | ||
| ); | ||
|
|
||
| CREATE TABLE vg103_orders ( | ||
| id INTEGER PRIMARY KEY, | ||
| total NUMERIC(10,2) NOT NULL | ||
| ); | ||
|
|
||
| CREATE TABLE vg105_users ( | ||
| id INTEGER PRIMARY KEY, | ||
| email TEXT NOT NULL | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [valk-guard] reported by reviewdog 🐶
VG101: model "vg101_users" references column "ghost_col" not found in table "vg101_users" schema; check migration DDL or update model mapping