Problem Statement
When migrating an existing application to use WebFiori's migration system, developers need a way to mark migrations as "applied" without executing them. The typical scenario:
- Production has 50+ tables already created manually
- Migrations are written so staging/testing can be built from scratch
- Running those migrations on production would fail (tables already exist)
- There's currently no CLI command to baseline/skip migrations
Proposed Solution
Add a migrations:skip CLI command that marks migrations as applied without executing them:
# Skip a single migration
php webfiori migrations:skip --name=App\\Database\\Migrations\\CreateUsersTable --connection=prod
# Skip ALL discovered migrations (baseline the whole DB)
php webfiori migrations:skip --all --connection=prod
# Skip everything up to a specific migration (inclusive)
php webfiori migrations:skip --up-to=CreateProductsTable --connection=prod
Command Arguments:
--name — Fully qualified class name (or short name) of a single migration to skip
--all — Skip all discovered migrations and seeders
--up-to — Skip all migrations up to and including the named one
--connection — Database connection name
--env — Environment (dev, staging, production)
Expected Output:
Skipped: App\Database\Migrations\CreateUsersTable
Skipped: App\Database\Migrations\CreateOrdersTable
Info: Total skipped: 2
Alternatives Considered
- Writing idempotent migrations — tedious for 50+ tables, doesn't cover all cases
--skip-failed flag on migrations:run — masks real errors alongside expected failures
- Interactive prompts on failure — breaks CI/CD pipelines
Breaking Change
No
Additional Context
Depends on: WebFiori/database#136 (adds skip()/skipAll()/skipUpTo() to SchemaRunner)
This follows the standard pattern from other frameworks:
- Flyway:
flyway baseline
- Django:
manage.py migrate --fake
- Liquibase:
changelogSync
Problem Statement
When migrating an existing application to use WebFiori's migration system, developers need a way to mark migrations as "applied" without executing them. The typical scenario:
Proposed Solution
Add a
migrations:skipCLI command that marks migrations as applied without executing them:Command Arguments:
--name— Fully qualified class name (or short name) of a single migration to skip--all— Skip all discovered migrations and seeders--up-to— Skip all migrations up to and including the named one--connection— Database connection name--env— Environment (dev, staging, production)Expected Output:
Alternatives Considered
--skip-failedflag onmigrations:run— masks real errors alongside expected failuresBreaking Change
No
Additional Context
Depends on: WebFiori/database#136 (adds
skip()/skipAll()/skipUpTo()toSchemaRunner)This follows the standard pattern from other frameworks:
flyway baselinemanage.py migrate --fakechangelogSync