From: Andrey Kutejko Date: Thu, 14 Aug 2014 21:22:24 +0000 (+0300) Subject: application level migrations X-Git-Tag: 0.6~200 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=9cbc965057192734d323d512e4577e73a62284b5;p=ipf.git application level migrations --- diff --git a/composer.lock b/composer.lock index 504f173..4bb3d9a 100644 --- a/composer.lock +++ b/composer.lock @@ -1,9 +1,10 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" ], - "hash": "6db86b9f680b207eb96f3a29764ab6ea", + "hash": "85f0406cc02d8f1f4650eb652d1cc65b", "packages": [ { "name": "andy128k/ipf-template", @@ -38,13 +39,42 @@ "description": "Template Engine extracted from IPF Web Framework", "time": "2013-10-06 15:58:13" }, + { + "name": "andy128k/migrations", + "version": "dev-master", + "source": { + "type": "git", + "url": "git://git.andy128k.net/migrations.git", + "reference": "5afec7c9931379fb1d2d2a889645ba0ccafdb8c5" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andrey Kutejko", + "email": "andy128k@gmail.com" + } + ], + "description": "Simple DB schema migrations", + "time": "2014-08-14 19:01:37" + }, { "name": "andy128k/missing-tools", "version": "0.2.x-dev", "source": { "type": "git", "url": "git://git.andy128k.net/missing-tools.git", - "reference": "d01d26b8e4b83e3779983f3d2f2eaea137067446" + "reference": "a37bcfc615daa8682efffb59fbe685aab93d19aa" }, "require": { "andy128k/pegp": "0.1.*@dev", @@ -69,7 +99,7 @@ } ], "description": "Miscellaneous utilities", - "time": "2014-02-26 22:23:08" + "time": "2014-07-22 11:53:58" }, { "name": "andy128k/pegp", @@ -211,7 +241,8 @@ "authors": [ { "name": "Michiel Rook", - "email": "mrook@php.net" + "email": "mrook@php.net", + "role": "Lead" }, { "name": "Vincent Blavet", @@ -234,16 +265,16 @@ "packages-dev": [ { "name": "phpunit/php-code-coverage", - "version": "1.2.16", + "version": "1.2.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "69e55e68481cf708a6db43aff0b504e31402fe27" + "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/69e55e68481cf708a6db43aff0b504e31402fe27", - "reference": "69e55e68481cf708a6db43aff0b504e31402fe27", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", + "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34", "shasum": "" }, "require": { @@ -291,7 +322,7 @@ "testing", "xunit" ], - "time": "2014-02-25 03:34:05" + "time": "2014-03-28 10:53:45" }, { "name": "phpunit/php-file-iterator", @@ -478,39 +509,38 @@ }, { "name": "phpunit/phpunit", - "version": "3.7.32", + "version": "3.7.37", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "2752cbb9ea5bd84c2811b34b6953f76965ec7a2f" + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2752cbb9ea5bd84c2811b34b6953f76965ec7a2f", - "reference": "2752cbb9ea5bd84c2811b34b6953f76965ec7a2f", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", + "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc", "shasum": "" }, "require": { + "ext-ctype": "*", "ext-dom": "*", + "ext-json": "*", "ext-pcre": "*", "ext-reflection": "*", "ext-spl": "*", "php": ">=5.3.3", - "phpunit/php-code-coverage": "~1.2.1", - "phpunit/php-file-iterator": ">=1.3.1", - "phpunit/php-text-template": ">=1.1.1", - "phpunit/php-timer": ">=1.0.4", - "phpunit/phpunit-mock-objects": "~1.2.0", + "phpunit/php-code-coverage": "~1.2", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.1", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~1.2", "symfony/yaml": "~2.0" }, "require-dev": { "pear-pear.php.net/pear": "1.9.4" }, "suggest": { - "ext-json": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "phpunit/php-invoker": ">=1.1.0,<1.2.0" + "phpunit/php-invoker": "~1.1" }, "bin": [ "composer/bin/phpunit" @@ -548,7 +578,7 @@ "testing", "xunit" ], - "time": "2014-02-25 03:47:29" + "time": "2014-04-30 12:24:19" }, { "name": "phpunit/phpunit-mock-objects", @@ -601,17 +631,17 @@ }, { "name": "symfony/yaml", - "version": "v2.4.2", + "version": "v2.5.3", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3" + "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/bb6ddaf8956139d1b8c360b4b713ed0138e876b3", - "reference": "bb6ddaf8956139d1b8c360b4b713ed0138e876b3", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", + "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", "shasum": "" }, "require": { @@ -620,7 +650,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -633,36 +663,30 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-01-07 13:28:54" + "time": "2014-08-05 09:00:40" } ], - "aliases": [ - - ], + "aliases": [], "minimum-stability": "stable", "stability-flags": { "andy128k/missing-tools": 20, + "andy128k/migrations": 20, "andy128k/pegp": 20, "andy128k/routeexpression": 20, "andy128k/ipf-template": 20 }, - "platform": [ - - ], - "platform-dev": [ - - ] + "prefer-stable": false, + "platform": [], + "platform-dev": [] } diff --git a/ipf/command/migrate.php b/ipf/command/migrate.php index 10c9264..082f7e8 100644 --- a/ipf/command/migrate.php +++ b/ipf/command/migrate.php @@ -7,9 +7,16 @@ class IPF_Command_Migrate public function run($args=null) { + $project = IPF_Project::getInstance(); + + $paths = array(IPF::get('project_path').'/db/migrations'); + foreach ($project->frameworkApps() as $app) { + $paths[] = $app->getPath() . 'migrations'; + } + $connection = IPF_ORM_Manager::getInstance()->getCurrentConnection()->getDbh(); $m = new \PFF\Migrations\Migrations; - $m->migrate($connection, IPF::get('project_path').'/db/migrations'); + $m->migrate($connection, $paths); } }