Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
compatibility to new package installation routine
Browse files Browse the repository at this point in the history
  • Loading branch information
malte-christian committed Sep 10, 2015
1 parent 085feda commit bc8dbb4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
27 changes: 0 additions & 27 deletions migrations/0000-00-00_init.php

This file was deleted.

18 changes: 18 additions & 0 deletions scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
});
}

},

/*
Expand All @@ -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');
}

},

/*
Expand Down

0 comments on commit bc8dbb4

Please sign in to comment.