| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | if (Schema::hasTable('question_choices')) return; |
||
| 17 | |||
| 18 | Schema::create('question_choices', function (Blueprint $table) { |
||
| 19 | $table->increments('id'); |
||
| 20 | $table->integer('question_id')->unsigned()->index(); |
||
| 21 | $table->enum('is_right_choice', [0, 1])->nullable(); |
||
| 22 | $table->text('choice'); |
||
| 23 | $table->timestamps(); |
||
| 24 | |||
| 25 | $table->foreign('question_id') |
||
| 26 | ->references('id') |
||
| 27 | ->on('quiz_questions') |
||
| 28 | ->onDelete('cascade') |
||
| 29 | ->onUpdate('cascade'); |
||
| 30 | }); |
||
| 43 |