PHP code example of oniti / migration_manager
1. Go to this page and download the library: Download oniti/migration_manager library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
oniti / migration_manager example snippets
php
use Oniti\Migrations\iMigration;
class CreateFieldRefDossier implements iMigration {
public function up() : string{
return "ALTER TABLE `compte` ADD `ref_dossier` VARCHAR(255) NULL AFTER `active`";
}
public function down() : string{
return "ALTER TABLE `compte` DROP `ref_dossier`;";
}
}
shell
php migrate
shell
php migrate --rollback
shell
php migrate --rollback --step=xxx