Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create('courses', function (Blueprint $table) { |
||
17 | $table->increments('id'); |
||
18 | $table->string('name')->nullable(); |
||
19 | $table->string('institution')->nullable(); |
||
20 | $table->integer('course_status_id')->unsigned()->nullable(); |
||
21 | $table->date('start_date')->nullable(); |
||
22 | $table->date('end_date')->nullable(); |
||
23 | $table->integer('applicant_id')->unsigned(); |
||
24 | $table->timestamps(); |
||
25 | }); |
||
26 | |||
27 | Schema::create('course_status', function (Blueprint $table) { |
||
28 | $table->increments('id'); |
||
29 | $table->string('name'); |
||
30 | $table->timestamps(); |
||
31 | }); |
||
32 | |||
33 | Schema::table('courses', function (Blueprint $table) { |
||
34 | $table->foreign('course_status_id')->references('id')-> |
||
35 | on('course_status')->onUpdate('CASCADE')->onDelete('NO ACTION'); |
||
36 | $table->foreign('applicant_id')->references('id')-> |
||
37 | on('applicants')->onUpdate('CASCADE')->onDelete('CASCADE'); |
||
38 | }); |
||
52 |