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

00PHP

Since Jun 22Pushed todayCompare

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

READMEChangelogDependenciesVersions (1)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

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

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.

### 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.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

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

8351.6M87](/packages/propel-propel1)[yemenopensource/filament-excel

This package useful for importing excel files into models.

194.2k](/packages/yemenopensource-filament-excel)

PHPackages © 2026

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