-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.php
48 lines (32 loc) · 1.52 KB
/
scripts.php
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
return [
'enable' => function($app) {
$util = $app['db']->getUtility();
if ($util->tableExists('@logger') === false) {
$util->createTable('@logger', function ($table) {
$table->addColumn('id', 'integer', ['unsigned' => true, 'length' => 10, 'autoincrement' => true]);
$table->addColumn('log_hash', 'string', ['length' => 40]);
$table->addColumn('count', 'integer', ['length' => 10]);
$table->addColumn('error_level', 'integer', ['length' => 3]);
$table->addColumn('logger_name', 'string', ['length' => 24]);
$table->addColumn('dates', 'json_array', ['notnull' => false]);
$table->addColumn('messages', 'json_array', ['notnull' => false]);
$table->addColumn('exception', 'json_array', ['notnull' => false]);
$table->setPrimaryKey(['id']);
});
}
if ($util->tableExists('@logger_options') === false) {
$util->createTable('@logger_options', function ($table) {
$table->addColumn('id', 'integer', ['unsigned' => true, 'length' => 10, 'autoincrement' => true]);
$table->addColumn('log_hash', 'string', ['length' => 40]);
$table->addColumn('details', 'json_array');
$table->setPrimaryKey(['id']);
$table->addUniqueIndex(['log_hash'], 'LOG_HASH');
});
}
},
'updates' => [
],
'disable' => function ($app) {
}
];