From: Andrey Kutejko Date: Fri, 1 Aug 2014 20:13:44 +0000 (+0300) Subject: migrations X-Git-Tag: 0.6~204 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=3abdb41de1698e5bd4dad7a876d0cf6c699a7239;p=ipf.git migrations --- diff --git a/composer.json b/composer.json index ca6f242..21b9160 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "pear/archive_tar": "1.3.*", "mustangostang/spyc": "0.5.*", "andy128k/missing-tools": "0.2.*@dev", + "andy128k/migrations": "dev-master", "andy128k/pegp": "0.1.*@dev", "andy128k/routeexpression": "dev-master", "andy128k/ipf-template": "dev-master" diff --git a/ipf/cli.php b/ipf/cli.php index dfecfba..1f52c1c 100644 --- a/ipf/cli.php +++ b/ipf/cli.php @@ -21,6 +21,8 @@ class IPF_Cli new IPF_Command_Pack, new IPF_Command_Unpack, new IPF_Command_CreateSuperUser, + new IPF_Command_CreateMigration, + new IPF_Command_Migrate, new IPF_Command_SyncPerms, ); diff --git a/ipf/command/createmigration.php b/ipf/command/createmigration.php new file mode 100644 index 0000000..adca2d9 --- /dev/null +++ b/ipf/command/createmigration.php @@ -0,0 +1,15 @@ +createMigration(IPF::get('project_path').'/db/migrations', implode('_', $args)); + echo "Create new migration $filename\n"; + } +} + diff --git a/ipf/command/migrate.php b/ipf/command/migrate.php new file mode 100644 index 0000000..10c9264 --- /dev/null +++ b/ipf/command/migrate.php @@ -0,0 +1,15 @@ +getCurrentConnection()->getDbh(); + $m = new \PFF\Migrations\Migrations; + $m->migrate($connection, IPF::get('project_path').'/db/migrations'); + } +} +