Rules
Every rule is an error by default, except those marked warn. Change a rule's severity in the config, for example { "rules": { "no-rename-column": "warn" } }, or set it to "off".
To accept one finding, put a suppression comment with a reason above the statement:
ts
// preflight safety-assured <rule-id> -- <reason>Data loss
| Rule | Reports |
|---|---|
no-drop-and-recreate-column | A column dropped and added again in one migration |
possible-rename-data-loss | One column dropped and another added, with no data copied (warn) |
no-drop-column | A dropped column |
no-drop-table | A dropped table |
no-truncate | TRUNCATE or clearTable() |
typeorm/no-changecolumn-recreate | changeColumn() that drops and re-adds the column |
typeorm/no-enum-recreate | TypeORM 0.3's enum change by recreating the type (warn) |
Deploy safety
| Rule | Reports |
|---|---|
no-rename-column | A renamed column |
no-rename-table | A renamed table |
Locking (PostgreSQL only)
| Rule | Reports |
|---|---|
require-concurrent-index | CREATE INDEX without CONCURRENTLY |
concurrent-index-transaction | CONCURRENTLY where it runs inside a transaction |
no-add-not-null-without-default | A NOT NULL column added without a default |
no-volatile-default | A column added with a volatile default, or as serial, identity, or stored generated |
no-unsafe-column-type-change | A column type change that rewrites the table |
require-not-valid-foreign-key | A foreign key added without NOT VALID |
no-set-not-null | SET NOT NULL on an existing column |
require-not-valid-check | A CHECK constraint added without NOT VALID |
require-concurrent-unique | A unique constraint or primary key added in place |
require-concurrent-index-drop | DROP INDEX without CONCURRENTLY (warn) |
no-blocking-maintenance | VACUUM FULL, CLUSTER, or REINDEX without CONCURRENTLY |
enum-value-used-in-same-transaction | A new enum value used before the transaction that adds it commits |
require-lock-timeout | A change to an existing table without lock_timeout (off, opt-in) |
Correctness
| Rule | Reports |
|---|---|
unanalyzable-statement | A statement orm-preflight could not read (warn) |
invalid-suppression | A suppression comment with no reason or an unknown rule |
no-edit-applied-migration | With --changed-since: an edit to an applied migration |
require-down | An empty or missing down() (warn) |
typeorm/transaction-override-forbidden | transaction set on a migration in transaction mode "all" |
typeorm/invalid-migration-name | A migration name without a 13-digit timestamp |