This directory contains all SQL for the Customer Feedback demo app.
db/
├── install.sql # Master orchestrator (called from scripts/deploy.sql)
├── schema/
│ ├── 000_schema_migrations.sql # Migration tracking table (idempotent)
│ └── 001_create_feedback.sql # cf_feedback table + indexes (idempotent)
└── migrations/
├── 002_seed_data.sql # Sample data (idempotent MERGE)
└── 003_add_category.sql # THE DEMO MOMENT: adds category column
- Numbered prefix on every file (
NNN_description.sql). Numbers are sequential, three digits, no gaps.validate.ymlenforces this. - Idempotent. Every script can be run repeatedly without error:
- DDL is wrapped in PL/SQL blocks that catch
ORA-00955(object exists) orORA-01430(column exists). - DML uses
MERGEkeyed on natural keys.
- DDL is wrapped in PL/SQL blocks that catch
- No bare
COMMITat file top — let the master script control transactions when possible. DDL auto-commits regardless. WHENEVER SQLERROR EXITis configured by the caller (scripts/deploy.sql), so any unhandled error aborts the pipeline.
- Create the next sequentially-numbered file in
db/migrations/. - Wrap DDL in
BEGIN ... EXCEPTION WHEN OTHERS THEN ... END;with the appropriateSQLCODEcheck. - Add an
@@migrations/NNN_xxx.sqlline plus itsschema_migrationsMERGEtodb/install.sql. - Open a PR.
validate.ymlwill check numbering and idempotency hygiene.