From 03dcba276033d372d28ce58f4b51f42a1592b2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20Ioni=C8=9B=C4=83?= Date: Mon, 25 Nov 2024 02:39:16 +0200 Subject: [PATCH] fix: temp table performance (#103) --- ...024_11_25_000959_update_to_temp_tables.php | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 database/migrations/2024_11_25_000959_update_to_temp_tables.php diff --git a/database/migrations/2024_11_25_000959_update_to_temp_tables.php b/database/migrations/2024_11_25_000959_update_to_temp_tables.php new file mode 100644 index 0000000..194d14b --- /dev/null +++ b/database/migrations/2024_11_25_000959_update_to_temp_tables.php @@ -0,0 +1,52 @@ +id(); + + $table->foreign('election_id') + ->references('id') + ->on('elections') + ->cascadeOnDelete(); + }); + + Schema::table('_temp_records', function (Blueprint $table) { + $table->id(); + + $table->foreign('election_id') + ->references('id') + ->on('elections') + ->cascadeOnDelete(); + }); + + Schema::table('_temp_mandates', function (Blueprint $table) { + $table->id(); + + $table->foreign('election_id') + ->references('id') + ->on('elections') + ->cascadeOnDelete(); + }); + + Schema::table('_temp_votes', function (Blueprint $table) { + $table->id(); + + $table->foreign('election_id') + ->references('id') + ->on('elections') + ->cascadeOnDelete(); + }); + } +};