https://github.com/dotblue/nextras-migrations-command
Easy setup for nextras/migrations with kdyby/console
https://github.com/dotblue/nextras-migrations-command
Last synced: 10 months ago
JSON representation
Easy setup for nextras/migrations with kdyby/console
- Host: GitHub
- URL: https://github.com/dotblue/nextras-migrations-command
- Owner: dotblue
- License: other
- Created: 2014-03-09T09:59:40.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-05T14:41:16.000Z (over 11 years ago)
- Last Synced: 2024-04-22T01:28:31.237Z (about 2 years ago)
- Language: PHP
- Size: 316 KB
- Stars: 3
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
## Easy setup for [nextras/migrations](https://github.com/nextras/migrations) with [kdyby/console](https://github.com/Kdyby/Console)
#### Requirements
- PHP 5.4+
- [nextras/migrations](https://github.com/nextras/migrations) >= 2.1
- [kdyby/console](https://github.com/Kdyby/Console) >= 2.0 (optional)
- [kdyby/events](https://github.com/Kdyby/Events) >= 2.0 (optional)
## Installation
1) Copy source codes from Github or using [Composer](http://getcomposer.org/):
```sh
$ composer require dotblue/nextras-migrations-command@~1.0
```
2) Register as Configurator's extension:
```
extensions:
migrations: DotBlue\Migrations\MigrationsExtension
```
3) Set configuration to fit your app:
```
migrations:
extensions:
sql: Nextras\Migrations\Extensions\NetteDbSql
groups:
structures: %appDir%/../sql
```
4) By default, migrations use Nette\Database to connect to DB.
```
nette:
database:
dsn:
user:
password:
```
## `symfony/console` or `kdyby/console`?
You can use this extension with plain Symfony Console. But if you use Kdyby Console, command will get registered automatically.
## `kdyby/events` ?
if you use `kdyby/events`, you can listen to following events:
- `nextras.migrations.success` (when migrations finish successfully)
- `nextras.migrations.fail` (when migrations finish with exception)
- `nextras.migrations.complete` (when migrations finish regardless outcome)