tenet-database-migrationslisted
Install: claude install-skill inceptyon-labs/tenet-skills
# Tenet Database Migrations
Audits database evolution risk. This catches schema changes that can break production data, lock large tables, or leave the app unable to roll back safely.
## Language Support Matrix
```yaml
support:
native: [sql, typescript, javascript, python, go, ruby]
heuristic: [java, csharp, php]
config-only: [yaml, json]
```
## Procedure
### Step 0: Detect Applicability
Applicable when the repo contains migrations or schema files:
- `migrations/`, `db/migrate/`, `prisma/schema.prisma`, `drizzle`, `knex`, `typeorm`, `sequelize`, Alembic, Django migrations, Rails migrations, Flyway, Liquibase
If no database schema/migration files exist, write `score: null`, `applicable: false`.
### Step 1: Destructive Operations
Scan migrations for:
- `DROP TABLE`, `DROP COLUMN`, `TRUNCATE`, destructive `ALTER TYPE`, `DELETE FROM` without `WHERE`
- column type narrowing, `NOT NULL` additions without defaults/backfills
Severity:
- `critical`: destructive production data operation with no backup/rename/dual-write plan
- `major`: potentially locking/destructive migration with no phased rollout note
- `minor`: destructive operation appears limited to test/dev schemas
### Step 2: Indexes, Constraints, and Query Shape
Check schemas and migrations for:
- Foreign keys without indexes on high-use relations
- Unique constraints missing for natural keys used in lookups
- Nullable columns used as required app fields
- Missing `ON DELETE` behavior for dependent rows
Seve