Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 36 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| CreateSchedulerJobProviderTable | |
0.00% |
0 / 36 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| up | |
0.00% |
0 / 35 |
|
0.00% |
0 / 1 |
2 | |||
| down | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Database\Migrations; |
| 4 | |
| 5 | use CodeIgniter\Database\Migration; |
| 6 | |
| 7 | class CreateSchedulerJobProviderTable 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 | 'job_id' => [ |
| 19 | 'type' => 'INT', |
| 20 | 'constraint' => 11, |
| 21 | 'unsigned' => true, |
| 22 | ], |
| 23 | 'provider' => [ |
| 24 | 'type' => 'VARCHAR', |
| 25 | 'constraint' => 100, |
| 26 | ], |
| 27 | 'enabled' => [ |
| 28 | 'type' => 'TINYINT', |
| 29 | 'default' => 1, |
| 30 | ], |
| 31 | 'created_at' => [ |
| 32 | 'type' => 'DATETIME', |
| 33 | 'null' => true, |
| 34 | ], |
| 35 | ]); |
| 36 | |
| 37 | $this->forge->addKey('id', true); |
| 38 | $this->forge->addKey('job_id'); |
| 39 | |
| 40 | $this->forge->addForeignKey( |
| 41 | 'job_id', |
| 42 | 'scheduler_job', |
| 43 | 'id', |
| 44 | 'CASCADE', |
| 45 | 'CASCADE' |
| 46 | ); |
| 47 | |
| 48 | $this->forge->createTable('scheduler_job_provider', true); |
| 49 | } |
| 50 | |
| 51 | public function down() |
| 52 | { |
| 53 | $this->forge->dropTable('scheduler_job_provider'); |
| 54 | } |
| 55 | } |