Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | $this->schema->create((new ReactionCounter())->getTable(), function (Blueprint $table) { |
||
26 | $table->bigIncrements('id'); |
||
27 | $table->unsignedBigInteger('reactant_id'); |
||
28 | $table->unsignedBigInteger('reaction_type_id'); |
||
29 | $table->unsignedBigInteger('count'); |
||
30 | $table->decimal('weight', 13, 2); |
||
31 | $table->timestamps(); |
||
32 | |||
33 | $table->index([ |
||
34 | 'reactant_id', |
||
35 | 'reaction_type_id', |
||
36 | ], 'love_reactant_reaction_counters_reactant_reaction_type_index'); |
||
37 | |||
38 | $table |
||
39 | ->foreign('reactant_id') |
||
40 | ->references('id') |
||
41 | ->on('love_reactants') |
||
42 | ->onDelete('cascade'); |
||
43 | $table |
||
44 | ->foreign('reaction_type_id') |
||
45 | ->references('id') |
||
46 | ->on('love_reaction_types') |
||
47 | ->onDelete('cascade'); |
||
48 | }); |
||
49 | } |
||
50 | |||
59 |