Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
2.04% |
1 / 49 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CreateChannelSettingTable | |
2.04% |
1 / 49 |
|
50.00% |
1 / 2 |
5.76 | |
0.00% |
0 / 1 |
| up | |
0.00% |
0 / 48 |
|
0.00% |
0 / 1 |
2 | |||
| down | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Database\Migrations; |
| 4 | |
| 5 | use CodeIgniter\Database\Migration; |
| 6 | |
| 7 | class CreateChannelSettingTable 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 | 'sms_enabled' => [ |
| 20 | 'type' => 'TINYINT', |
| 21 | 'constraint' => 1, |
| 22 | 'default' => 0, |
| 23 | ], |
| 24 | |
| 25 | 'whatsapp_enabled' => [ |
| 26 | 'type' => 'TINYINT', |
| 27 | 'constraint' => 1, |
| 28 | 'default' => 0, |
| 29 | ], |
| 30 | |
| 31 | 'email_enabled' => [ |
| 32 | 'type' => 'TINYINT', |
| 33 | 'constraint' => 1, |
| 34 | 'default' => 0, |
| 35 | ], |
| 36 | |
| 37 | 'default_sms_provider' => [ |
| 38 | 'type' => 'VARCHAR', |
| 39 | 'constraint' => 100, |
| 40 | 'null' => true, |
| 41 | ], |
| 42 | |
| 43 | 'default_whatsapp_provider' => [ |
| 44 | 'type' => 'VARCHAR', |
| 45 | 'constraint' => 100, |
| 46 | 'null' => true, |
| 47 | ], |
| 48 | |
| 49 | 'default_email_provider' => [ |
| 50 | 'type' => 'VARCHAR', |
| 51 | 'constraint' => 100, |
| 52 | 'null' => true, |
| 53 | ], |
| 54 | |
| 55 | 'created_at' => [ |
| 56 | 'type' => 'DATETIME', |
| 57 | 'null' => true, |
| 58 | ], |
| 59 | |
| 60 | 'updated_at' => [ |
| 61 | 'type' => 'DATETIME', |
| 62 | 'null' => true, |
| 63 | ], |
| 64 | ]); |
| 65 | |
| 66 | $this->forge->addKey('id', true); |
| 67 | |
| 68 | $this->forge->createTable('channel_setting', true); |
| 69 | } |
| 70 | |
| 71 | public function down() |
| 72 | { |
| 73 | $this->forge->dropTable('channel_setting', true); |
| 74 | } |
| 75 | } |