Skip to content

klobinoid/migrations

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migrations

Build Status Downloads this Month Stable version

Migrations for Nette Framework Database (and others db layers).

Forked Clevis\Migrations, enhanced and updated for Nette Database.

Implemented drivers for:

  • Nette Database MySQL
  • Nette Database PostgreSQL

Workflow

// prepare driver
$connection = new Nette\Database\Connection('mysql:dbname=testdb', 'root', 'root');
$context = new Nette\Database\Context($connection);
$driver = new Nextras\Migrations\Drivers\MySqlNetteDbDriver($context, 'migrations');

// create controller
// choose http or cli controller
$controller = new Nextras\Migrations\Controllers\HttpController($driver);

// add groups of migration files & their dependencies on other groups
$controller->addGroup('structures', __DIR__ . '/structures');
$controller->addGroup('data', __DIR__ . '/data', ['structures']);

// add supported extension
$controller->addExtension('sql', new Nextras\Migrations\Extensions\NetteDbSql($context));

// run controller
$controller->run();

About

Simple DB migrations for Nette Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 98.0%
  • CSS 1.8%
  • HTML 0.2%