- Notifications
You must be signed in to change notification settings - Fork18
Automatic migration generation
License
cycle/migrations
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Migrations are a convenient way for you to alter your database in a structured and organized manner. This package addsadditional functionality for versioning your database schema and easily deploying changes to it. It is a very easy touse and a powerful tool.
composer require cycle/migrations ^4.0
useCycle\Migrations;useCycle\Database;useCycle\Database\Config;$dbal =newDatabase\DatabaseManager(newConfig\DatabaseConfig(['default' =>'default','databases' => ['default' => ['connection' =>'sqlite' ] ],'connections' => ['sqlite' =>newConfig\SQLiteDriverConfig( connection:newConfig\SQLite\MemoryConnectionConfig(), queryCache:true, ), ]]));$config =newMigrations\Config\MigrationConfig(['directory' =>__DIR__ .'/../migrations/',// where to store migrations'vendorDirectories' => [// Where to look for vendor package migrations__DIR__ .'/../vendor/vendorName/packageName/migrations/' ],'table' =>'migrations'// database table to store migration status 'safe' => true// When set to true no confirmation will be requested on migration run.]);$migrator =newMigrations\Migrator($config,$dbal,newMigrations\FileRepository($config));// Init migration table$migrator->configure();
while (($migration =$migrator->run()) !==null) {echo'Migrate' .$migration->getState()->getName();}
You can automatically generate a set of migration files during schema compilation. In this case, you have the freedom toalter such migrations manually before running them. To achieve that you must installtheSchema migrations generator extension.
MIT License (MIT). Please seeLICENSE for more information. MaintainedbySpiral Scout.
About
Automatic migration generation
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
