Download the PHP package t4web/migrations without Composer
On this page you can find all versions of the php package t4web/migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download t4web/migrations
More information about t4web/migrations
Files in t4web/migrations
Package migrations
Short Description ZF2 Module for database migrations management.
License BSD-3-Clause
Homepage https://github.com/t4web/Migrations
Informations about the package migrations
Migrations
Simple Migrations for Zend Framework 2.
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
Using composer
or add to your composer.json
Then add T4web\Migrations
to the modules
array in application.config.php
Configuration
Add to your configuration:
General options:
The top-level key used to configure this module is migrations
.
Migration Configurations: Migrations
Each key under migrations
is a migrations configuration.
Sub-key: dir
The path to the directory where migration files are stored. Defaults to ./migrations
in the project root dir.
Sub-key: namespace
The class namespace that migration classes will be generated with. Defaults to T4web\Migrations
.
Sub-key: show_log
(optional)
Flag to log output of the migration. Defaults to true
.
Sub-key: adapter
(optional)
The service alias that will be used to fetch a Zend\Db\Adapter\Adapter
from the service manager.
Usage
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 [<version>] [--force] [--down]
- apply or rollback migrationmigration generate
- generate migration class
Migration classes are stored in /path/to/project/migrations/
dir by default.
Generic migration class has name Version_<YmdHis>
and implement T4web\Migrations\Migration\MigrationInterface
.
Migration class example
Accessing ServiceLocator In Migration Class
All versions of migrations with dependencies
zendframework/zend-db Version ^2.5
zendframework/zend-modulemanager Version ^2.5
zendframework/zend-servicemanager Version ^2.5
zendframework/zend-console Version ^2.5
zendframework/zend-mvc Version ^2.5
zendframework/zend-text Version ^2.5
t4web/filesystem Version 1.0.0