From 3abdb41de1698e5bd4dad7a876d0cf6c699a7239 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Fri, 1 Aug 2014 23:13:44 +0300 Subject: [PATCH] migrations --- composer.json | 1 + ipf/cli.php | 2 ++ ipf/command/createmigration.php | 15 +++++++++++++++ ipf/command/migrate.php | 15 +++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 ipf/command/createmigration.php create mode 100644 ipf/command/migrate.php 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'); + } +} + -- 2.49.0