| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateH5pContentsUserDataTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('h5p_contents_user_data', function (Blueprint $table) { |
||
| 17 | $table->bigInteger('content_id')->unsigned(); |
||
| 18 | $table->bigInteger('user_id')->unsigned(); |
||
| 19 | $table->bigInteger('sub_content_id')->unsigned(); |
||
| 20 | $table->string('data_id', 127); |
||
| 21 | $table->text('data'); |
||
| 22 | $table->boolean('preload')->default(0); |
||
| 23 | $table->boolean('invalidate')->default(0); |
||
| 24 | $table->dateTime('updated_at')->default(DB::raw('CURRENT_TIMESTAMP')); |
||
| 25 | // $table->dateTime('updated_at')->default('0000-00-00 00:00:00'); |
||
| 26 | $table->primary(['content_id', 'user_id', 'sub_content_id', 'data_id'], 'fk_primary'); |
||
| 27 | }); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Reverse the migrations. |
||
| 32 | * |
||
| 33 | * @return void |
||
| 34 | */ |
||
| 35 | public function down() |
||
| 38 | } |
||
| 39 | } |
||
| 40 |