webware/webware-migration is the migration component for the Webware stack. It
provides the migration contract, deterministic discovery and ordering, durable
applied-migration tracking with SHA-256 integrity checksums, reverse-order
rollback, and the migrate/status/rollback commands surfaced by
webware-console.
- PHP
~8.4.1 || ~8.5.0
composer require webware/webware-migrationDefine a migration:
use Webware\Migration\Migration\AbstractMigration;
final class Migration001CreateRoles extends AbstractMigration
{
public function up(): void
{
// create the roles table
}
public function down(): void
{
// drop the roles table
}
}Register discovered migrations in the container config and operate through the
migrate, status, and rollback commands provided by webware-console.
Migration000{Name}— creates the component's schema.Migration001{Name}— seeds the component's base data.Migration002{Name}and up — ordinary migrations.
Schema and seed run before every later migration, so 000/001 are reserved
for them.
Versioned documentation lives under docs/: