Skip to content

Replace FuelPHP migration module with Phinx (transitional, until Laravel cutover) #36

Description

@notfoundsam

Context

Schema DDL is managed by FuelPHP's migration module (fuelphp/fuel/app/migrations/NNN_*.php). Two problems make it unfit for the FuelPHP→Laravel migration:

  1. Strict sequential ordinals (001_, 002_...). Two branches both adding 008_* collide and force a renumber + retest. Applied-state config (app/config/<env>/migrations.php) is auto-generated and not git-tracked, so state diverges across machines and CI.
  2. FuelPHP-only. The DBUtil API and migration table don't carry to Laravel.

Decision recorded in ADR-016 (docs/adr/016-database-migrations-phinx.md).

Approach

Phinx as a transitional runner, deleted at Laravel cutover. The 7 existing FuelPHP migrations are already applied everywhere - dump the live schema to a committed bootstrap.sql baseline, delete the FuelPHP migration files, Phinx runs on top.

  • Phinx pinned to 0.13.x (last PHP 7.4 line; FuelPHP container is 7.4.33), require-dev in fuelphp/composer.json
  • fuelphp/migrations/ + fuelphp/phinx.php, version_order: creation (timestamp ordering kills ordinal collisions)
  • phinx.php reads getenv() directly - not a Config-over-getenv violation, Phinx runs outside the FuelPHP bootstrap
  • fresh env: load bootstrap.sql -> phinx migrate

Scope

  • composer require --dev robmorgan/phinx:^0.13 in fuelphp/
  • fuelphp/phinx.php config (mysql adapter from RDS_* env, version_order: creation)
  • dump live schema -> fuelphp/migrations/bootstrap.sql (mysqldump --no-data, exclude migration table)
  • delete fuelphp/fuel/app/migrations/* + tracking config
  • Make targets: db-migrate, db-rollback, db-migrate-status, db-migrate-create, db-bootstrap-dump, db-bootstrap-load
  • wire bootstrap.sql load into fresh-env setup (make install)

Not doing now

Laravel migrations. At cutover: php artisan schema:dump snapshots the live schema as Laravel's baseline, drop phinxlog, remove Phinx + fuelphp/migrations/. Phinx and Laravel never conflict (separate tracking tables); no compatibility work needed.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions