Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
CreateOrganizationTable
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 up
0.00% covered (danger)
0.00%
0 / 27
0.00% covered (danger)
0.00%
0 / 1
2
 down
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Database\Migrations;
4
5use CodeIgniter\Database\Migration;
6
7class CreateOrganizationTable extends Migration
8{
9    public function up()
10    {
11        $this->forge->addField([
12            'id' => [
13                'type'           => 'INT',
14                'constraint'     => 11,
15                'unsigned'       => true,
16                'auto_increment' => true,
17            ],
18
19            'name' => [
20                'type'       => 'VARCHAR',
21                'constraint' => 255,
22            ],
23
24            'type' => [
25                'type'       => 'ENUM',
26                'constraint' => ['company', 'individual'],
27                'default'    => 'company',
28            ],
29
30            'created_at' => [
31                'type' => 'DATETIME',
32                'null' => true,
33            ],
34
35            'updated_at' => [
36                'type' => 'DATETIME',
37                'null' => true,
38            ],
39        ]);
40
41        $this->forge->addKey('id', true);
42        $this->forge->createTable('organization');
43    }
44
45    public function down()
46    {
47        $this->forge->dropTable('organization');
48    }
49}