Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function up() |
||
15 | { |
||
16 | Schema::create($this->tablePrefix.'entities', function (Blueprint $table) { |
||
17 | $table->uuid('id')->primary(); |
||
18 | $table->unsignedInteger('module_id'); |
||
19 | $table->unsignedInteger('record_id'); |
||
20 | $table->unsignedInteger('creator_id')->nullable(); |
||
21 | $table->timestamps(); |
||
22 | |||
23 | $table->index('module_id', 'record_id'); |
||
24 | |||
25 | // Foreign keys |
||
26 | $table->foreign('module_id') |
||
27 | ->references('id')->on($this->tablePrefix.'modules') |
||
28 | ->onDelete('cascade'); |
||
29 | |||
30 | $table->foreign('creator_id') |
||
31 | ->references('id')->on('users'); |
||
32 | |||
33 | // Index |
||
34 | $table->index(array('module_id', 'creator_id')); |
||
35 | }); |
||
48 |