Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function up(): void |
||
17 | { |
||
18 | Schema::create(config('rinvex.categories.tables.categorizables'), function (Blueprint $table) { |
||
19 | // Columns |
||
20 | $table->integer('category_id')->unsigned(); |
||
21 | $table->morphs('categorizable'); |
||
22 | $table->timestamps(); |
||
23 | |||
24 | // Indexes |
||
25 | $table->unique(['category_id', 'categorizable_id', 'categorizable_type'], 'categorizables_ids_type_unique'); |
||
26 | $table->foreign('category_id')->references('id')->on(config('rinvex.categories.tables.categories')) |
||
27 | ->onDelete('cascade')->onUpdate('cascade'); |
||
28 | }); |
||
29 | } |
||
30 | |||
41 |