PHPackages                             tobento/app-migration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. tobento/app-migration

ActiveLibrary[Database &amp; ORM](/categories/database)

tobento/app-migration
=====================

App migration support.

2.0.3(5mo ago)028220MITPHPPHP &gt;=8.4

Since Mar 30Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/tobento-ch/app-migration)[ Packagist](https://packagist.org/packages/tobento/app-migration)[ Docs](https://www.tobento.ch)[ RSS](/packages/tobento-app-migration/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (10)Used By (20)

App Migration
=============

[](#app-migration)

App migration support.

Table of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-started)
    - [Requirements](#requirements)
- [Documentation](#documentation)
    - [App](#app)
    - [Migration Boot](#migration-boot)
        - [Install and Uninstall Migration](#install-and-uninstall-migration)
        - [Create Migration](#create-migration)
        - [Replace Migration](#replace-migration)
    - [Console](#console)
        - [Migration List Command](#migration-list-command)
        - [Migration Install Command](#migration-install-command)
        - [Migration Uninstall Command](#migration-uninstall-command)
- [Credits](#credits)

---

Getting Started
===============

[](#getting-started)

Add the latest version of the app migration project running this command.

```
composer require tobento/app-migration

```

Requirements
------------

[](#requirements)

- PHP 8.4 or greater

Documentation
=============

[](#documentation)

App
---

[](#app)

Check out the [App Skeleton](https://github.com/tobento-ch/app-skeleton) if you are using the skeleton.

You may also check out the [App](https://github.com/tobento-ch/app) to learn more about the app in general.

Migration Boot
--------------

[](#migration-boot)

The migration boot does the following:

- definition of \\Tobento\\Service\\Migration\\MigratorInterface::class
- definition of \\Tobento\\Service\\Migration\\MigrationResultsInterface::class
- installs and loads migration config file
- adds install and uninstall app macros

```
use Tobento\App\AppFactory;

// Create the app
$app = new AppFactory()->createApp();

// Adding boots
$app->boot(\Tobento\App\Migration\Boot\Migration::class);

// Run the app
$app->run();
```

### Install and Uninstall Migration

[](#install-and-uninstall-migration)

Once the [Migration Boot](#migration-boot) has been booted you may install migrations by the following ways:

```
use Tobento\App\Boot;
use Tobento\App\Migration\Boot\Migration;

class AnyServiceBoot extends Boot
{
    public const BOOT = [
        // you may ensure the migration boot.
        Migration::class,
    ];

    public function boot(Migration $migration)
    {
        // Install migrations
        $migration->install(AnyMigration::class);

        // Uninstall migrations
        $migration->uninstall(AnyMigration::class);

        // Install migrations with app macro
        $this->app->install(AnyMigration::class);

        // Uninstall migrations with app macro
        $this->app->uninstall(AnyMigration::class);
    }
}
```

### Create Migration

[](#create-migration)

Check out the [Migration Service](https://github.com/tobento-ch/service-migration) to learn more about creating migration classes.

### Replace Migration

[](#replace-migration)

You may replace a migration with another migration using the `replace` method:

```
use Tobento\App\Boot;
use Tobento\App\Migration\Boot\Migration;

class AnyServiceBoot extends Boot
{
    public const BOOT = [
        // you may ensure the migration boot.
        Migration::class,
    ];

    public function boot(Migration $migration)
    {
        $migration->replace(
            SomeMigration::class,
            ReplaceWithThisMigration::class
        );
    }
}
```

Console
-------

[](#console)

If you have installed the [App Console](https://github.com/tobento-ch/app-console) you may run the following commands.

### Migration List Command

[](#migration-list-command)

The `migration:list` command provides an overview of all the migrations installed:

```
php ap migration:list

```

### Migration Install Command

[](#migration-install-command)

Install a migration by its class:

```
php ap migration:install --name=Namespace\Migration

```

Reinstalls all migrations:

```
php ap migration:install --all

```

Reinstalls specific migration(s) or/and action(s) by its ids. To get the ids, run `migration:list` command:

```
php ap migration:install --id=12|23

```

Reinstalls specific migration(s) or/and action(s) by its type.

```
php ap migration:install --type=database|views

```

### Migration Uninstall Command

[](#migration-uninstall-command)

Uninstall a migration by its class:

```
php ap migration:uninstall --name=Namespace\Migration

```

Uninstalls all migrations:

```
php ap migration:uninstall --all

```

Uninstalls specific migration(s) by its ids. To get the ids, run `migration:list` command:

```
php ap migration:uninstall --id=12|23

```

Credits
=======

[](#credits)

- [Tobias Strub](https://www.tobento.ch)
- [All Contributors](../../contributors)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance73

Regular maintenance activity

Popularity15

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~150 days

Recently: every ~38 days

Total

10

Last Release

151d ago

Major Versions

1.x-dev → 2.0.22025-10-01

PHP version history (2 changes)1.0.0PHP &gt;=8.0

2PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/055d6a1b5c2384bb179c75ab0b55914231d898fdc4dffeb30770f81200e52206?d=identicon)[TOBENTOch](/maintainers/TOBENTOch)

---

Top Contributors

[![tobento-ch](https://avatars.githubusercontent.com/u/16684832?v=4)](https://github.com/tobento-ch "tobento-ch (21 commits)")

---

Tags

phpmigrationpackageapplicationtobento

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tobento-app-migration/health.svg)

```
[![Health](https://phpackages.com/badges/tobento-app-migration/health.svg)](https://phpackages.com/packages/tobento-app-migration)
```

###  Alternatives

[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10923.2k](/packages/awssat-laravel-sync-migration)[robinncode/db_craft

DB Craft is a CodeIgniter4 Seeder, Migration Generator. Automatic Migration Generation: DB-Craft provides a simple command-line interface to generate migration files automatically based on the connected database. This feature allows developers to keep track of database schema changes and easily apply them to different environments. Table-Specific Migrations: Developers can also generate migration files for specific tables, providing granular control over database changes. This flexibility allows for efficient database management and versioning. Seeding Support: DB-Craft includes functionality to generate seeders, enabling developers to populate their database with initial data. This feature is especially useful for setting up sample data or populating reference tables.

194.2k](/packages/robinncode-db-craft)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
