Flyway Migrations
Firmiana uses Flyway for versioned schema management. There are 23 migrations (V1–V23).
Migration History
Migration Naming
Migrations follow the Flyway convention: V{version}__{description}.sql
Double underscore (__) separates the version from the description.
Adding New Migrations
Create a new SQL file in src/main/resources/db/migration/:
The file should contain only DDL statements (CREATE TABLE, ALTER TABLE, CREATE INDEX).
Warning
Never modify existing migration files. If you need to change the schema, create a new migration.
Baseline Migration
The baseline schema (V1) creates the core tables:
users,user_passwords,user_access_tokens,user_refresh_tokensrooms,room_user,room_aliasesevent,event_relationsforward_extremity,room_state_groupdevice_inbox,device_list_streamtyping_user,presence_stream,receipt,room_receiptmedia_metadata,media_auth_tokenuser_push_rules,user_pushersnotification,event_push_summary
Database Reset
To reset the database:
Flyway will re-run all migrations from scratch.