Skip to content

Repository files navigation

Webware Migration

PHP Version Latest Version License Continuous Integration codecov Mutation testing badge

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.

Requirements

  • PHP ~8.4.1 || ~8.5.0

Installation

composer require webware/webware-migration

Usage

Define 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.

Version convention

  • 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.

Documentation

Versioned documentation lives under docs/:

About

Webware Migration — schema and data migration interfaces for the Webware component stack

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages