Rules for creating Knex migrations in Uptime Kuma
masterWhen writing database migrations for Uptime Kuma, follow these constraints to ensure compatibility across supported database engines (SQLite and MariaDB):
- Primary Keys: Every table must include a primary key named
id. - Filename Format: Use the pattern
YYYY-MM-DD-HHMM-patch-name.js. - Syntax: Do not use native SQL syntax. Use Knex methods exclusively to maintain cross-database compatibility.
- Transactions: By default, migrations run in a transaction. If you need to disable this, you can export a
configobject withtransaction: false.