Create a Flyway SQL migration for: $ARGUMENTS
Current Migrations
!ls infra-db/src/main/resources/db/migration/
Rules
- •Find the highest existing version number from migration filenames
- •Create the new file as
V{N+1}__<snake_case_description>.sqlininfra-db/src/main/resources/db/migration/ - •Start the file with a comment header:
-- <description of what this migration does> - •Write valid PostgreSQL 16 SQL
- •Use
IF NOT EXISTS/IF EXISTSguards where appropriate - •Add
COMMENT ONfor new tables/columns - •Never modify existing migration files — they are immutable once applied
Reference: Existing Schema
The documents table schema is defined in V1. Read it if you need to reference existing columns:
infra-db/src/main/resources/db/migration/V1__create_documents_table.sql
After Creating
Report the full path and contents of the new migration file.