| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public function up() |
||
| 18 | { |
||
| 19 | Schema::create($this->tablePrefix.'modules_widgets', function(Blueprint $table) { |
||
| 20 | $table->increments('id'); |
||
| 21 | $table->unsignedInteger('domain_id')->nullable(); |
||
| 22 | $table->unsignedInteger('module_id'); |
||
| 23 | $table->unsignedInteger('user_id')->nullable(); |
||
| 24 | $table->unsignedInteger('widget_id'); |
||
| 25 | $table->text('data')->nullable(); |
||
| 26 | $table->timestamps(); |
||
| 27 | |||
| 28 | // Foreign keys |
||
| 29 | $table->foreign('domain_id') |
||
| 30 | ->references('id')->on($this->tablePrefix.'domains') |
||
| 31 | ->onDelete('cascade'); |
||
| 32 | |||
| 33 | $table->foreign('module_id') |
||
| 34 | ->references('id')->on($this->tablePrefix.'modules') |
||
| 35 | ->onDelete('cascade'); |
||
| 36 | |||
| 37 | $table->foreign('user_id') |
||
| 38 | ->references('id')->on('users') |
||
| 39 | ->onDelete('cascade'); |
||
| 40 | |||
| 41 | $table->foreign('widget_id') |
||
| 42 | ->references('id')->on($this->tablePrefix.'widgets') |
||
| 43 | ->onDelete('cascade'); |
||
| 44 | }); |
||
| 57 |