From 90546e8e16867df4dc9c210d66e136e9431fa78b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Sat, 4 Jan 2025 05:27:44 -0500 Subject: [PATCH] fix: use table names from config file (#261) --- ..._000000_create_love_reactant_reaction_counters_table.php | 6 ++++-- ...25_001000_create_love_reactant_reaction_totals_table.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php b/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php index e21ad0b9..33233b57 100644 --- a/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php +++ b/database/migrations/2018_07_25_000000_create_love_reactant_reaction_counters_table.php @@ -11,7 +11,9 @@ declare(strict_types=1); +use Cog\Laravel\Love\Reactant\Models\Reactant; use Cog\Laravel\Love\Reactant\ReactionCounter\Models\ReactionCounter; +use Cog\Laravel\Love\ReactionType\Models\ReactionType; use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; @@ -38,12 +40,12 @@ public function up(): void $table ->foreign('reactant_id') ->references('id') - ->on('love_reactants') + ->on((new Reactant())->getTable()) ->onDelete('cascade'); $table ->foreign('reaction_type_id') ->references('id') - ->on('love_reaction_types') + ->on((new ReactionType())->getTable()) ->onDelete('cascade'); }); } diff --git a/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php b/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php index b2798989..4f70fbff 100644 --- a/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php +++ b/database/migrations/2018_07_25_001000_create_love_reactant_reaction_totals_table.php @@ -11,6 +11,7 @@ declare(strict_types=1); +use Cog\Laravel\Love\Reactant\Models\Reactant; use Cog\Laravel\Love\Reactant\ReactionTotal\Models\ReactionTotal; use Cog\Laravel\Love\Support\Database\Migration; use Illuminate\Database\Schema\Blueprint; @@ -32,7 +33,7 @@ public function up(): void $table ->foreign('reactant_id') ->references('id') - ->on('love_reactants') + ->on((new Reactant())->getTable()) ->onDelete('cascade'); }); }