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

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

erykai/migration
================

Auto create tables database mysql

v1.2.1(3y ago)0961MITPHPPHP &gt;=8.0

Since Aug 15Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Erykai/migration)[ Packagist](https://packagist.org/packages/erykai/migration)[ GitHub Sponsors](https://github.com/Erykai)[ RSS](/packages/erykai-migration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (1)

Migration
=========

[](#migration)

[![Maintainer](https://camo.githubusercontent.com/8d0c30a6e6bb0e588086373acb7d3cb9c1ff2135f91a52d1a7a99a8670aa1090/687474703a2f2f696d672e736869656c64732e696f2f62616467652f6d61696e7461696e65722d40616c657864656f766964616c2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://instagram.com/alexdeovidal)[![Source Code](https://camo.githubusercontent.com/6a7c1dc4aa9ea4e6dfe1201de56960d2fcb881018e4f5df6b1610182193b3088/687474703a2f2f696d672e736869656c64732e696f2f62616467652f736f757263652d6572796b61692f6d6967726174696f6e2d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/erykai/migration)[![PHP from Packagist](https://camo.githubusercontent.com/4cec39f2a582e56d9126b59bbf40a7b10b7873ded3199ba034b168280aa83e04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6572796b61692f6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erykai/migration)[![Latest Version](https://camo.githubusercontent.com/eaabbbe8d2b97681bff4a7c9907e63b0acec9735d5747f64f1544a1c2d9b2849/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6572796b61692f6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/erykai/migration/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Quality Score](https://camo.githubusercontent.com/9c3455c846971b2f8bb527bad8cddfaeb1061a4c11dbaed02bf47adfbab19857/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6572796b61692f6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/erykai/migration)[![Total Downloads](https://camo.githubusercontent.com/222e331ccf8dc0fb2f7b51eca05d3902335fc2ddfc460313e6dd267a585bd51f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6572796b61692f6d6967726174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/erykai/migration)

Auto create tables mysql

Installation
------------

[](#installation)

Composer:

```
"erykai/migration": "1.0.*"
```

Terminal

```
composer require erykai/migration
```

Create users.php

```
use Erikai\Migration;
require "vendor/autoload.php";
$create = new Migration();
$create->table('users');
$create->column('id')->type('int(11)')->default();
$create->column('name')->type('varchar(255)')->default();
$create->column('password')->type('text')->default()->null();
$create->column('email')->type('varchar(255)')->default();
$create->column('level')->type('int(11)')->default();
$create->column('profile')->type('varchar(255)')->default()->null();
$create->column('cover')->type('varchar(255)')->default()->null();
$create->column('created_at')->type('timestamp')->default("current_timestamp()");
$create->column('updated_at')->type('timestamp')->default("current_timestamp() ON UPDATE current_timestamp()");
$create->save();
$create->primary('id');
$create->autoIncrement('id');
```

Create posts\_categories.php

```
use Erikai\Migration;
require "vendor/autoload.php";
$create = new Migration();
$create->table('posts_categories');
$create->column('id')->type('int(11)')->default();
$create->column('id_user')->type('int(11)')->default();
$create->column('title')->type('varchar(255)')->default();
$create->column('created_at')->type('timestamp')->default("current_timestamp()");
$create->column('updated_at')->type('timestamp')->default("current_timestamp() ON UPDATE current_timestamp()");
$create->save();
$create->primary('id');
$create->autoIncrement('id');
$create->addKey('users_categories', "id_user", "users", "id");
```

Create posts.php

```
use Erikai\Migration;
require "vendor/autoload.php";
$create = new Migration();
$create->table('posts');
$create->column('id')->type('int(11)')->default();
$create->column('id_user')->type('int(11)')->default();
$create->column('id_category')->type('int(11)')->default();
$create->column('title')->type('varchar(255)')->default();
$create->column('description')->type('text')->default();
$create->column('cover')->type('varchar(255)')->default()->null();
$create->column('created_at')->type('timestamp')->default("current_timestamp()");
$create->column('updated_at')->type('timestamp')->default("current_timestamp() ON UPDATE current_timestamp()");
$create->save();
$create->primary('id');
$create->autoIncrement('id');
$create->addKey('users_posts', "id_user", "users", "id");
$create->addKey('posts_categories', "id_category", "posts_categories", "id");
```

Contribution
------------

[](#contribution)

All contributions will be analyzed, if you make more than one change, make the commit one by one.

Support
-------

[](#support)

If you find faults send an email reporting to .

Credits
-------

[](#credits)

- [Alex de O. Vidal](https://github.com/alexdeovidal) (Developer)
- [All contributions](https://github.com/erykai/migration/contributors) (Contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License](https://github.com/erykai/migration/LICENSE) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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 ~58 days

Total

5

Last Release

1138d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1795fc67d400661b64ca8a84adeabe383f32b2925daed4d63ec0ef51f14837f?d=identicon)[alexdeovidal](/maintainers/alexdeovidal)

---

Top Contributors

[![alexdeovidal](https://avatars.githubusercontent.com/u/8947446?v=4)](https://github.com/alexdeovidal "alexdeovidal (9 commits)")

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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