Download the PHP package dtforce/fornettey-doctrine-migrations without Composer
On this page you can find all versions of the php package dtforce/fornettey-doctrine-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dtforce/fornettey-doctrine-migrations
More information about dtforce/fornettey-doctrine-migrations
Files in dtforce/fornettey-doctrine-migrations
Package fornettey-doctrine-migrations
Short Description Implementation of Doctrine Migrations for Nette
License MIT
Informations about the package fornettey-doctrine-migrations
Doctrine Migrations
Implementation of Doctrine\Migrations to Nette.
Install
Register extensions in config.neon
:
Configuration
config.neon
with default values
Usage
Open your CLI and run command (based on DTForce\NetteConsole
integration):
Migrate changes to database
If you want to migrate existing migration to your database, just run migrate commmand:
If you get lost, just use -h
option for help:
Create new migration
To create new empty migration, just run:
A new empty migration will be created at your migrations directory. You can add your sql there then.
Migration that would add new role "superadmin"
to user_role
table would look like this:
As simple as that!
For further use, please check docs in Symfony bundle.
Features
Cleanup your directories
If you have over 100 migrations in one directory, it might get messy. How to make it nicer? You can create a subdirectory and move some migrations there. I would group them up by year or by purpose. All subdirectories of directory
you set up in configuration will be scanned.
It can look like this:
Injected migrations
All versions of fornettey-doctrine-migrations with dependencies
doctrine/migrations Version ~1.0
nette/di Version ~2.3
symfony/console Version ~2.7|~3.0