| # | Severity | Subject | Reason | Statement |
|---|---|---|---|---|
| 1 | safe | *ast.CommentNode | does not remove data or tighten constraints | -- Disable foreign-key enforcement for the table rebuild below |
| 2 | safe | *ast.RawSQLNode | does not remove data or tighten constraints | PRAGMA foreign_keys = off |
| 3 | safe | *ast.CommentNode | does not remove data or tighten constraints | -- SQLite table rebuild for changes ALTER TABLE cannot express on products |
| 4 | safe | *ast.CreateTableNode | does not remove data or tighten constraints | CREATE TABLE "__ptah_rebuild_products" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "sku" TEXT NOT NULL UNIQUE, "name" TEXT NOT NULL, "price_cents" INTEGER NOT NULL ) |
| 5 | safe | *ast.RawSQLNode | does not remove data or tighten constraints | INSERT INTO "__ptah_rebuild_products" ("id", "sku", "name", "price_cents") SELECT "id", "sku", "name", "price_cents" FROM "products" |
| 6 | destructive | products | DROP TABLE removes the table and all rows | DROP TABLE "products" |
| 7 | warning | *ast.RawSQLNode | rename can break deployed readers and writers | ALTER TABLE "__ptah_rebuild_products" RENAME TO "products" |
| 8 | destructive | legacy_inventory | DROP TABLE removes the table and all rows | -- WARNING: This will delete all data! DROP TABLE IF EXISTS "legacy_inventory" |
| 9 | safe | *ast.CommentNode | does not remove data or tighten constraints | -- Restore foreign-key enforcement after the table rebuild |
| 10 | safe | *ast.RawSQLNode | does not remove data or tighten constraints | PRAGMA foreign_keys = on |