PHPackages                             shincoder/harmless-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. shincoder/harmless-migration

AbandonedArchivedLibrary

shincoder/harmless-migration
============================

11981PHP

Since Jan 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/shincoder/harmless-migration)[ Packagist](https://packagist.org/packages/shincoder/harmless-migration)[ RSS](/packages/shincoder-harmless-migration/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

### A Laravel 5 package to test database migrations

[](#a-laravel-5-package-to-test-database-migrations)

Please don't use in production environments YET!! We still need some tests &amp;&amp; feedback.

#### Why

[](#why)

Mysql does not allow wrapping table operations in transactions (Postgresql does), that's why when you screw one of your migrations, you are basically left in an irreparable broken state.

So the main idea behind this package is the following:

- We create a testing database for every connection specified by the user (or use the default one).
- We switch the configuration to the new database at runtime, replacing the real database.
- We refresh the connection so that Laravel can use the new configuration.
- We run `php artisan migrate` against the testing database.
- When done, we drop the testing database.
- Any eventual errors are displayed to the user.
- The real database stays intact.

#### Sqlite not supported

[](#sqlite-not-supported)

Sqlite databases are not supported for the time being. If someone has an idea that would be great.

#### Install

[](#install)

`composer require shincoder/harmless-migration:dev-master`

#### Add the service provider

[](#add-the-service-provider)

Edit your `config/app.php` providers array, add the following:

```
'Shincoder\Harmless\HarmlessServiceProvider',
```

#### Migrate away

[](#migrate-away)

The package has no way to guess which connections you are using. So if you use multiple database connections you **Must** specify them all using the `--database=db1,db2` option. If not, the command will use the default connection in `config/database.php`.

If you don't specify all your connections, some of you migrations will still be run against your real database. This shouldn't be an issue if you only use your default connection.

- Default database connection `php artisan migrate:test`
- Multiple database connections `php artisan migrate:test --database=defaultConnection1,connection2`

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3e82a2925f6a3d4d3161613f4643b5e9cf8e36a97c5b30c2c158e88fbe0e2094?d=identicon)[shincoder](/maintainers/shincoder)

---

Top Contributors

[![jaouadk](https://avatars.githubusercontent.com/u/6833740?v=4)](https://github.com/jaouadk "jaouadk (15 commits)")

### Embed Badge

![Health badge](/badges/shincoder-harmless-migration/health.svg)

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

PHPackages © 2026

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