Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
2.50% covered (danger)
2.50%
1 / 40
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
CreateSystemUpdateTable
2.50% covered (danger)
2.50%
1 / 40
50.00% covered (danger)
50.00%
1 / 2
5.71
0.00% covered (danger)
0.00%
0 / 1
 up
0.00% covered (danger)
0.00%
0 / 39
0.00% covered (danger)
0.00%
0 / 1
2
 down
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace App\Database\Migrations;
4
5use CodeIgniter\Database\Migration;
6
7class CreateSystemUpdateTable extends Migration
8{
9    public function up()
10    {
11        $this->forge->addField([
12
13            'id' => [
14                'type' => 'INT',
15                'constraint' => 11,
16                'unsigned' => true,
17                'auto_increment' => true,
18            ],
19
20            'version_from' => [
21                'type' => 'VARCHAR',
22                'constraint' => 20,
23            ],
24
25            'version_to' => [
26                'type' => 'VARCHAR',
27                'constraint' => 20,
28            ],
29
30            'status' => [
31                'type' => 'VARCHAR',
32                'constraint' => 50,
33            ],
34
35            'logs' => [
36                'type' => 'LONGTEXT',
37                'null' => true,
38            ],
39
40            'rollback_available' => [
41                'type' => 'TINYINT',
42                'constraint' => 1,
43                'default' => 0,
44            ],
45
46            'started_at' => [
47                'type' => 'DATETIME',
48                'null' => true,
49            ],
50
51            'completed_at' => [
52                'type' => 'DATETIME',
53                'null' => true,
54            ],
55        ]);
56
57        $this->forge->addKey('id', true);
58
59        $this->forge->createTable('system_update');
60    }
61
62    public function down()
63    {
64        $this->forge->dropTable('system_update');
65    }
66}