| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateH5pResultsTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('h5p_results', function (Blueprint $table) { |
||
| 17 | $table->bigIncrements('id'); |
||
| 18 | $table->bigInteger('content_id')->unsigned(); |
||
| 19 | $table->bigInteger('user_id')->unsigned(); |
||
| 20 | $table->bigInteger('score')->unsigned(); |
||
| 21 | $table->bigInteger('max_score')->unsigned(); |
||
| 22 | $table->bigInteger('opened')->unsigned(); |
||
| 23 | $table->bigInteger('finished')->unsigned(); |
||
| 24 | $table->bigInteger('time')->unsigned(); |
||
| 25 | $table->index(['content_id', 'user_id'], 'content_user'); |
||
| 26 | }); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Reverse the migrations. |
||
| 31 | * |
||
| 32 | * @return void |
||
| 33 | */ |
||
| 34 | public function down() |
||
| 37 | } |
||
| 38 | } |
||
| 39 |