Files
law-api/database/migrations/2024_04_02_173603_create_branches_table.php

40 lines
1.0 KiB
PHP

<?php
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::create('branches', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->integer('number');
$table->foreignId('book_id')->nullable();
$table->foreignId('volum_id')->nullable();
$table->foreignId('law_id')->nullable();
$table->foreignId('gate_id')->nullable();
$table->foreignId('part_id')->nullable();
$table->foreignId('chapter_id')->nullable();
$table->foreignId('section_id')->nullable();
$table->foreignId('division_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('branches');
}
};