so-manager-dev.com/database/migrations/2026_01_16_144753_create_management_table.php
y.higashide e8eca949df
All checks were successful
Deploy so-manager (auto) / deploy (push) Successful in 23s
database/migrations/2026_01_16_144753_create_management_table.php を更新
2026-01-16 15:28:25 +09:00

35 lines
1.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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('management', function (Blueprint $table) {
$table->id('management_id'); // 主キー、AUTO_INCREMENT, NOT NULL
$table->string('management_name', 255); // varchar(255), NOT NULL
$table->string('management_code', 10)->unique(); // varchar(10), NOT NULL, UNIQUE
$table->boolean('municipality_flag')->nullable(); // tinyint(1), NULL
$table->boolean('government_approval_required')->nullable(); // tinyint(1), NULL
$table->boolean('valid_flag'); // tinyint(1)
$table->timestamps(); // created_at, updated_at (datetime), NOT NULL
$table->unsignedInteger('operator_id')->nullable(); // int(10), NULL
$table->foreign('operator_id')->references('ope_id')->on('ope'); // 外部キーopeテーブルのope_idを参照
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('management');
}
};