| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create($this->tablePrefix.'permissions', function(Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->unsignedInteger('module_id'); |
||
| 19 | $table->unsignedInteger('profile_id'); |
||
| 20 | $table->unsignedInteger('capability_id'); |
||
| 21 | $table->timestamps(); |
||
| 22 | |||
| 23 | // Foreign keys |
||
| 24 | $table->foreign('module_id') |
||
| 25 | ->references('id')->on($this->tablePrefix.'modules') |
||
| 26 | ->onDelete('cascade'); |
||
| 27 | |||
| 28 | $table->foreign('profile_id') |
||
| 29 | ->references('id')->on($this->tablePrefix.'profiles') |
||
| 30 | ->onDelete('cascade'); |
||
| 31 | |||
| 32 | $table->foreign('capability_id') |
||
| 33 | ->references('id')->on($this->tablePrefix.'capabilities') |
||
| 34 | ->onDelete('cascade'); |
||
| 35 | |||
| 36 | // Unique keys |
||
| 37 | $table->unique([ 'module_id', 'profile_id', 'capability_id' ]); |
||
| 38 | }); |
||
| 51 |