PHPackages                             sinuspi/migri - 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. sinuspi/migri

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

sinuspi/migri
=============

Lightweight DB migration lib

1.0.0(1mo ago)02MITPHPPHP &gt;=5.6

Since Jun 22Pushed 1mo agoCompare

[ Source](https://github.com/SinusPi/php_migri)[ Packagist](https://packagist.org/packages/sinuspi/migri)[ RSS](/packages/sinuspi-migri/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Migri is a simple schema migration library. It manages MySQL table creation and versioned migrations with version tracking in table comments.

Migrations are defined as an associative array, where keys define "checkpoints" (CREATE TABLE) or "transitions" (ALTER TABLE). Multiple table definitions can be daisy-chained.

Usage:

```
$db = new \mysqli(...); // or new \PDO(...)
new \SinusPi\Migri\Migri($db)
	->manageTable("users", [
		"1"   => "CREATE TABLE users (...)",
		"1>2" => "ALTER TABLE users ADD COLUMN ...",
		"2>3" => "ALTER TABLE users ADD COLUMN ...",
		"3"   => "CREATE TABLE users (...)",  // Reset point for fresh installs
		"3>4" => "ALTER TABLE users ADD COLUMN ...",
	])
	->manageTable("widgets", [
		"1" => "CREATE TABLE  (...)"
	])
	;
```

*All* intermediate steps *must* be defined. Missing a step in the sequence throws an error.

Optionally, use `` placeholder to avoid repetition of table name.

Compatible with PHP 5.6+, \\mysqli and \\PDO.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance90

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

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

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7799341?v=4)[Sinus](/maintainers/sinuspi)[@SinusPi](https://github.com/SinusPi)

### Embed Badge

![Health badge](/badges/sinuspi-migri/health.svg)

```
[![Health](https://phpackages.com/badges/sinuspi-migri/health.svg)](https://phpackages.com/packages/sinuspi-migri)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.8k117.8M121](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)

PHPackages © 2026

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