"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"
new IPF_Command_Pack,
new IPF_Command_Unpack,
new IPF_Command_CreateSuperUser,
+ new IPF_Command_CreateMigration,
+ new IPF_Command_Migrate,
new IPF_Command_SyncPerms,
);
--- /dev/null
+<?php
+
+class IPF_Command_CreateMigration
+{
+ public $command = 'createmigration';
+ public $description = 'Create migration';
+
+ public function run($args=null)
+ {
+ $m = new \PFF\Migrations\Migrations;
+ $filename = $m->createMigration(IPF::get('project_path').'/db/migrations', implode('_', $args));
+ echo "Create new migration $filename\n";
+ }
+}
+
--- /dev/null
+<?php
+
+class IPF_Command_Migrate
+{
+ public $command = 'migrate';
+ public $description = 'Migrate DB schema';
+
+ public function run($args=null)
+ {
+ $connection = IPF_ORM_Manager::getInstance()->getCurrentConnection()->getDbh();
+ $m = new \PFF\Migrations\Migrations;
+ $m->migrate($connection, IPF::get('project_path').'/db/migrations');
+ }
+}
+