first
This commit is contained in:
27
database/migrations/2026_06_02_000002_create_duns_table.php
Normal file
27
database/migrations/2026_06_02_000002_create_duns_table.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('duns', function (Blueprint $table): void {
|
||||
$table->id();
|
||||
$table->foreignId('election_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('code', 20);
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unique(['election_id', 'code']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('duns');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user