PHPackages                             soft4good/poorman-migrations - 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. soft4good/poorman-migrations

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

soft4good/poorman-migrations
============================

A lightweight, standalone database migrations manager with support for multiple environments. Featuring base schemas and seeds.

1.3(6y ago)0116MITPHP

Since Mar 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/soft4good/poorman-migrations)[ Packagist](https://packagist.org/packages/soft4good/poorman-migrations)[ Docs](https://github.com/soft4good/poorman-migrations)[ RSS](/packages/soft4good-poorman-migrations/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Poorman Migrations
==================

[](#poorman-migrations)

A lightweight, standalone migrations manager for MySQL databases with support for multiple environments. Featuring base schemas and seeds.

### Installation

[](#installation)

```
$ composer require soft4good/poorman-migrations
$ vendor/bin/poorman-migrations setup
```

This will add a `.env` file and a `db/` directory to your project root.

If you have multiple environments you can create env files for each like: `.env.development`, `.env.staging`, `.env.production`, etc...

**IMPORTANT:** Make sure to *.gitignore* your `.env` files so you don't leak sensitive info to the repository.

#### The `db/` directory contains three subdirs:

[](#the-db-directory-contains-three-subdirs)

#### `db/migrations/`

[](#dbmigrations)

Migrations are SQL scripts with instructions to modify the database structure.

Migration filename syntax: `_.sql`

Auto-generate migrations using the `gen:migration` task (see usage below)

**NOTE:** You may be tempted to add INSERT queries (seed data) on the migration scripts. PLEASE DON'T DO THIS, seed data for the specific environments should be placed in the SQL scripts found in the `seeds/` directory. On reset operations, the migration scripts are ran immediately after the database structure is reset and there is no data, placing seed data in these files may fail foreign key checks rendering the migration invalid.

#### `db/seeds/`

[](#dbseeds)

Seeds are SQL scripts with instructions to populate your database with seed data.

Here you can add seed data by environment, the default is local (`local.sql`).

#### `db/schemas`

[](#dbschemas)

Schemas are the base/initial structure of your database, these scripts are supposed to contain structure-only code.

Here you can add schemas by environment, the default is local (`local.sql`).

### Usage

[](#usage)

Poorman Migrations will expose `vendor/bin/poorman-migrations`. Usage is as follows:

Syntax:

```
$ ./poorman  [|]

```

Where:

**&lt;task&gt;:** setup | migrate | reset | init | seed | gen:migration

**&lt;environment&gt;:** development | staging | production | etc...

**&lt;artifact\_name&gt;:** Required for ``, the name of the migration (e.g. 'new\_user\_fields')

#### setup

[](#setup)

You should run this task as part of the installation step. It will interactively create a `.env` file with the credentials to the database provided by you and the base `db` directory.

#### init

[](#init)

Loads the DB schema by executing the sql script on `db/schemas` specific to the specified environment, default is `local`.

So for example:

```
$ vendor/bin/poorman-migrations init
```

will run `db/schemas/local.sql`

while:

```
$ vendor/bin/poorman-migrations development
```

will run `db/schemas/development.sql`.

#### seed

[](#seed)

Loads database seeds from the `db/seeds` directory for the specified environment, default is `local`.

So for example:

```
$ vendor/bin/poorman-migrations seed
```

will run `db/seeds/local.sql`

while:

```
$ vendor/bin/poorman-migrations seed development
```

will run `db/seeds/development.sql`.

#### migrate

[](#migrate)

Will execute database migrations found in the `db/migrations` directory. Migrations are ran in order taking into account the timestamp in the filename.

We keep track of already migrated scripts by looking at the `schema_migrations` table in the database, this table is created by the `migrate` task if it doesnt exist.

e.g.

```
$ vendor/bin/poorman-migrations migrate
```

You can also specify an environment to migrate as with the other tasks.

#### gen:migration

[](#genmigration)

This task will create an empty migration file with the `artifact_name` specified.

e.g.

```
$ vendor/bin/poorman-migrations gen:migration create_users_table
```

This example will create a file `db/migrations/_create_users_table.sql`.

You can now add your sql statements to this SQL file and it will be executed the next time you run the `migrate` task.

#### reset

[](#reset)

Doing a reset will run these tasks in the following order:

- `init`
- `migrate`
- `seed`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2246d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/628793?v=4)[Reinier G. Menendez](/maintainers/soft4good)[@soft4good](https://github.com/soft4good)

---

Top Contributors

[![soft4good](https://avatars.githubusercontent.com/u/628793?v=4)](https://github.com/soft4good "soft4good (14 commits)")

---

Tags

phpdatabasesqlstandaloneseedmigratios

### Embed Badge

![Health badge](/badges/soft4good-poorman-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/soft4good-poorman-migrations/health.svg)](https://phpackages.com/packages/soft4good-poorman-migrations)
```

###  Alternatives

[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[clouddueling/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k22.9k](/packages/clouddueling-mysqldump-php)[butschster/dbml-parser

DBML (database markup language) parser written on PHP8.

6416.8k2](/packages/butschster-dbml-parser)[elimuswift/db-exporter

Export your database quickly and easily as a Laravel Migration and all the data as a Seeder class.

364.7k](/packages/elimuswift-db-exporter)[friedolinfoerder/wp-activerecord

An ActiveRecord implementation for WordPress

237.2k](/packages/friedolinfoerder-wp-activerecord)

PHPackages © 2026

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