Skip to content

Commit 90546e8

Browse files
authored
fix: use table names from config file (#261)
1 parent fc7a2ad commit 90546e8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
declare(strict_types=1);
1313

14+
use Cog\Laravel\Love\Reactant\Models\Reactant;
1415
use Cog\Laravel\Love\Reactant\ReactionCounter\Models\ReactionCounter;
16+
use Cog\Laravel\Love\ReactionType\Models\ReactionType;
1517
use Cog\Laravel\Love\Support\Database\Migration;
1618
use Illuminate\Database\Schema\Blueprint;
1719

@@ -38,12 +40,12 @@ public function up(): void
3840
$table
3941
->foreign('reactant_id')
4042
->references('id')
41-
->on('love_reactants')
43+
->on((new Reactant())->getTable())
4244
->onDelete('cascade');
4345
$table
4446
->foreign('reaction_type_id')
4547
->references('id')
46-
->on('love_reaction_types')
48+
->on((new ReactionType())->getTable())
4749
->onDelete('cascade');
4850
});
4951
}

database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14+
use Cog\Laravel\Love\Reactant\Models\Reactant;
1415
use Cog\Laravel\Love\Reactant\ReactionTotal\Models\ReactionTotal;
1516
use Cog\Laravel\Love\Support\Database\Migration;
1617
use Illuminate\Database\Schema\Blueprint;
@@ -32,7 +33,7 @@ public function up(): void
3233
$table
3334
->foreign('reactant_id')
3435
->references('id')
35-
->on('love_reactants')
36+
->on((new Reactant())->getTable())
3637
->onDelete('cascade');
3738
});
3839
}

0 commit comments

Comments
 (0)