Conditions | 1 |
Paths | 1 |
Total Lines | 45 |
Code Lines | 37 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function up(): void |
||
26 | { |
||
27 | Schema::create('love_reactions', function (Blueprint $table) { |
||
28 | $table->bigIncrements('id'); |
||
29 | $table->unsignedBigInteger('reactant_id'); |
||
30 | $table->unsignedBigInteger('reacter_id'); |
||
31 | $table->unsignedBigInteger('reaction_type_id'); |
||
32 | $table->timestamps(); |
||
33 | |||
34 | $table->index('reactant_id'); |
||
35 | $table->index('reacter_id'); |
||
36 | $table->index('reaction_type_id'); |
||
37 | $table->index([ |
||
38 | 'reactant_id', |
||
39 | 'reaction_type_id', |
||
40 | ]); |
||
41 | $table->index([ |
||
42 | 'reactant_id', |
||
43 | 'reacter_id', |
||
44 | 'reaction_type_id', |
||
45 | ]); |
||
46 | $table->index([ |
||
47 | 'reactant_id', |
||
48 | 'reacter_id', |
||
49 | ]); |
||
50 | $table->index([ |
||
51 | 'reacter_id', |
||
52 | 'reaction_type_id', |
||
53 | ]); |
||
54 | |||
55 | $table |
||
56 | ->foreign('reactant_id') |
||
57 | ->references('id') |
||
58 | ->on('love_reactants') |
||
59 | ->onDelete('cascade'); |
||
60 | $table |
||
61 | ->foreign('reacter_id') |
||
62 | ->references('id') |
||
63 | ->on('love_reacters') |
||
64 | ->onDelete('cascade'); |
||
65 | $table |
||
66 | ->foreign('reaction_type_id') |
||
67 | ->references('id') |
||
68 | ->on('love_reaction_types') |
||
69 | ->onDelete('cascade'); |
||
70 | }); |
||
83 |