From bc8dbb40ba7e8b9570456db0c9adb523c48a1fd2 Mon Sep 17 00:00:00 2001 From: Malte Date: Thu, 10 Sep 2015 13:15:18 +0200 Subject: [PATCH] compatibility to new package installation routine --- migrations/0000-00-00_init.php | 27 --------------------------- scripts.php | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 27 deletions(-) delete mode 100644 migrations/0000-00-00_init.php diff --git a/migrations/0000-00-00_init.php b/migrations/0000-00-00_init.php deleted file mode 100644 index 6d700ea..0000000 --- a/migrations/0000-00-00_init.php +++ /dev/null @@ -1,27 +0,0 @@ - function() use ($app) { - - $util = $app['db']->getUtility(); - - if ($util->tableExists('@hello_greetings') === false) { - $util->createTable('@hello_greetings', function($table) { - $table->addColumn('id', 'integer', ['unsigned' => true, 'length' => 10, 'autoincrement' => true]); - $table->addColumn('name', 'string', ['length' => 255, 'default' => '']); - $table->setPrimaryKey(['id']); - }); - } - }, - - 'down' => function() use ($app) { - - $util = $app['db']->getUtility(); - - if ($util->tableExists('@hello_greetings')) { - $util->dropTable('@hello_greetings'); - } - } - -]; diff --git a/scripts.php b/scripts.php index fdd5409..7aef23f 100644 --- a/scripts.php +++ b/scripts.php @@ -7,6 +7,16 @@ */ 'install' => function ($app) { + $util = $app['db']->getUtility(); + + if ($util->tableExists('@hello_greetings') === false) { + $util->createTable('@hello_greetings', function ($table) { + $table->addColumn('id', 'integer', ['unsigned' => true, 'length' => 10, 'autoincrement' => true]); + $table->addColumn('name', 'string', ['length' => 255, 'default' => '']); + $table->setPrimaryKey(['id']); + }); + } + }, /* @@ -22,8 +32,16 @@ * */ 'uninstall' => function ($app) { + // remove the config $app['config']->remove('hello'); + + $util = $app['db']->getUtility(); + + if ($util->tableExists('@hello_greetings')) { + $util->dropTable('@hello_greetings'); + } + }, /*