Migrating your Database with Phinx
summary
Phinx is a standalone PHP database migration tool that uses timestamps-based filenames and a PHP DSL to create, run and reverse migrations. The demo builds a simple guestbook: creates a posts table with id and timestamps, adds a unique index to enforce one-signature-per-name, then rolls back and replays migrations against MySQL and PostgreSQL to prove portability. Project stats: ~32 releases, ~350k downloads, ~70 contributors, default in CakePHP 3.0. The new change method makes many migrations reversible automatically.
AI-written summary · about
chapters (13)
- 0:00Introduction to Phinx
- 2:27Why Phinx was created
- 4:13Benefits of Phinx
- 5:40Demo setup and overview
- 8:00Creating a database and tables
- 10:29Writing a Phinx migration
- 13:56Running migrations and results
- 15:20Rolling back migrations
- 16:46Adding unique indexes
- 17:30Reversible migrations
- 20:17Migrating to PostgreSQL
- 22:39Phinx future updates
- 24:05Q&A session
