PHPackages                             zored/zf-simple-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. zored/zf-simple-migrations

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

zored/zf-simple-migrations
==========================

Module for database migrations management.

0.2.1(8y ago)015BSD-3-ClausePHPPHP &gt;=5.4

Since Sep 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zored/ZfSimpleMigrations)[ Packagist](https://packagist.org/packages/zored/zf-simple-migrations)[ Docs](https://github.com/vgarvardt/ZfSimpleMigrations)[ RSS](/packages/zored-zf-simple-migrations/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

ZfSimpleMigrations
==================

[](#zfsimplemigrations)

Simple Migrations for Zend Framework 2. Project originally based on [ZendDbMigrations](https://github.com/vadim-knyzev/ZendDbMigrations) but module author did not response for issues and pull-requests so fork became independent project.

Supported Drivers
-----------------

[](#supported-drivers)

The following DB adapter drivers are supported by this module.

- Pdo\_Sqlite
- Pdo\_Mysql
- Mysqli *only if you configure the driver options with `'buffer_results' => true`*

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

[](#installation)

### Using composer

[](#using-composer)

```
php composer.phar require vgarvardt/zf-simple-migrations:dev-master
php composer.phar update
```

add `ZfSimpleMigrations` to the `modules` array in application.config.php

Usage
-----

[](#usage)

### Available commands

[](#available-commands)

- `migration version []` - show last applied migration (`name` specifies a configured migration)
- `migration list [] [--all]` - list available migrations (`all` includes applied migrations)
- `migration apply [] [] [--force] [--down] [--fake]` - apply or rollback migration
- `migration generate []` - generate migration skeleton class

Migration classes are stored in `/path/to/project/migrations/` dir by default.

Generic migration class has name `Version` and implement `ZfSimpleMigrations\Library\MigrationInterface`.

### Migration class example

[](#migration-class-example)

```
