| Total Complexity | 2 | 
| Total Lines | 31 | 
| Duplicated Lines | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 7 | class CreateModulesTable extends Migration  | 
            ||
| 8 | { | 
            ||
| 9 | public function up()  | 
            ||
| 10 |     { | 
            ||
| 11 |         Schema::create('modules', function (Blueprint $table) { | 
            ||
| 12 |             $table->increments('id'); | 
            ||
| 13 |             $table->unsignedInteger('page_id')->nullable(); | 
            ||
| 14 |             $table->string('collection', 32)->index(); | 
            ||
| 15 |             $table->string('slug'); | 
            ||
| 16 | $table->timestamps();  | 
            ||
| 17 | $table->softDeletes();  | 
            ||
| 18 | |||
| 19 |             $table->foreign('page_id')->references('id')->on('pages')->onDelete('cascade'); | 
            ||
| 20 | });  | 
            ||
| 21 | |||
| 22 |         Schema::create('module_translations', function (Blueprint $table) { | 
            ||
| 23 |             $table->increments('id'); | 
            ||
| 24 |             $table->integer('module_id')->unsigned(); | 
            ||
| 25 |             $table->string('locale'); | 
            ||
| 26 |             $table->string('title')->nullable(); | 
            ||
| 27 |             $table->text('content')->nullable(); | 
            ||
| 28 | $table->timestamps();  | 
            ||
| 29 | |||
| 30 |             $table->foreign('module_id')->references('id')->on('modules')->onDelete('cascade'); | 
            ||
| 31 | });  | 
            ||
| 32 | }  | 
            ||
| 33 | |||
| 34 | public function down()  | 
            ||
| 35 |     { | 
            ||
| 36 |         Schema::dropIfExists('module_translations'); | 
            ||
| 37 |         Schema::dropIfExists('modules'); | 
            ||
| 38 | }  | 
            ||
| 40 |