-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.php
More file actions
32 lines (29 loc) · 962 Bytes
/
scripts.php
File metadata and controls
32 lines (29 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
return [
'install' => function ($app) {
$util = $app['db']->getUtility();
if ($util->tableExists('@contact_emails') === false) {
$util->createTable('@contact_emails', function ($table) {
$table->addColumn('id', 'integer', ['unsigned' => true, 'length' => 10, 'autoincrement' => true]);
$table->addColumn('name', 'string');
$table->addColumn('email', 'string');
$table->addColumn('message', 'string');
$table->addColumn('date', 'string');
$table->setPrimaryKey(['id']);
});
}
},
'enable' => function ($app) {
},
'uninstall' => function ($app) {
$app['config']->remove('contact');
$util = $app['db']->getUtility();
if ($util->tableExists('@contact_emails')) {
$util->dropTable('@contact_emails');
}
},
'updates' => [
'0.0.5' => function ($app) {
},
],
];