Skip to content

Commit

Permalink
fix: temp table performance (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio authored Nov 25, 2024
1 parent 2c81d07 commit 03dcba2
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions database/migrations/2024_11_25_000959_update_to_temp_tables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

declare(strict_types=1);

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('_temp_turnouts', function (Blueprint $table) {
$table->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();
});
}
};

0 comments on commit 03dcba2

Please sign in to comment.