PHPackages                             vados/phalcon-migration-runner - 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. vados/phalcon-migration-runner

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

vados/phalcon-migration-runner
==============================

Easy migration runner for Phalcon framework

0.1(7y ago)158BSD-2-ClausePHPPHP &gt;=7.1.0

Since Feb 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ScaryDonetskiy/Phalcon-Migration-Runner)[ Packagist](https://packagist.org/packages/vados/phalcon-migration-runner)[ RSS](/packages/vados-phalcon-migration-runner/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Phalcon Migration Runner
========================

[](#phalcon-migration-runner)

![Packagist](https://camo.githubusercontent.com/8929810c2d0d4a5dbb2c871394b029be5e4f1c129a1f57063d091e56b9c805d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7661646f732f7068616c636f6e2d6d6967726174696f6e2d72756e6e65722e737667)![PHP from Packagist](https://camo.githubusercontent.com/ecdcdeb32eb210b22d275e293c916baf4e056e0415cf1b9265f5019b7469b154/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7661646f732f7068616c636f6e2d6d6967726174696f6e2d72756e6e65722e737667)![Packagist](https://camo.githubusercontent.com/6aa408736bc35953e86f3b77884146498deb82360db201f0c50457118239a5e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7661646f732f7068616c636f6e2d6d6967726174696f6e2d72756e6e65722e737667)[![GitHub Issues](https://camo.githubusercontent.com/dd1cdd2c4c4bc2bc8708834705a7828e93789086b9ba3e759eb1c674ce1a45a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f5363617279446f6e6574736b69792f5068616c636f6e2d4d6967726174696f6e2d52756e6e65722e737667)](https://camo.githubusercontent.com/dd1cdd2c4c4bc2bc8708834705a7828e93789086b9ba3e759eb1c674ce1a45a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f5363617279446f6e6574736b69792f5068616c636f6e2d4d6967726174696f6e2d52756e6e65722e737667)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/066a144f4808eac1cdb2a5aa13e321c4d8780597d9663503b2619cbbc8d11582/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f5363617279446f6e6574736b69792f5068616c636f6e2d4d6967726174696f6e2d52756e6e65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ScaryDonetskiy/Phalcon-Migration-Runner/?branch=master)[![Travis CI Status](https://camo.githubusercontent.com/3b0a45c11eef18879a97c254c44659ab2355aee574b0e8d1bee3d8c9011ec0c5/68747470733a2f2f7472617669732d63692e6f72672f5363617279446f6e6574736b69792f5068616c636f6e2d4d6967726174696f6e2d52756e6e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ScaryDonetskiy/Phalcon-Migration-Runner)

Works with PHP 7.1+

### Usage

[](#usage)

You can run command 'migration\_runner' for creating and applying or reverting migration to your database.

```
./vendor/bin/migration_runner
```

By default, runner call method 'help'.

Available methods

- help - Show help information
- create {name} - Create new migration
- up {runCount=0} - Apply new migrations
- down {runCount=1} - Revert some migration

In your migrations you should use Phalcon Pdo Adapter provided by method 'getDbConnection'. You can find API definition in [Phalcon documentation](https://docs.phalconphp.com/en/3.3/Phalcon_Db_AdapterInterface)

```
public function up(): bool
{
    $this->getDbConnection()->createTable('foo', null, [
        'columns' => [
            new \Phalcon\Db\Column('bar', [
                'type' => \Phalcon\Db\Column::TYPE_INTEGER
            ])
        ]
    ]);

    return true;
}
```

### Example

[](#example)

Create migration (For first run runner create config)

```
$ ./vendor/bin/migration_runner create new_migration

Enter database adapter (default: sqlite): sqlite
Enter database name (default: phalcon): test.db
Config generated in /my_project/migration_runner.config.php
Migration /my_project/migrations/m1522260172_new_migration.php created!
```

Describe your migration

```
