fix : 테이블 추가 및 수정 신규로 작성 (generator 설치)
composer require --dev kitloong/laravel-migrations-generator php artisan migrate:generate
This commit is contained in:
33
database/migrations/2025_07_26_051643_create_roles_table.php
Normal file
33
database/migrations/2025_07_26_051643_create_roles_table.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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('roles', function (Blueprint $table) {
|
||||
$table->bigIncrements('id')->comment('PK: 역할 ID');
|
||||
$table->unsignedBigInteger('tenant_id')->index();
|
||||
$table->string('name', 50)->comment('역할명');
|
||||
$table->string('description')->nullable()->comment('설명');
|
||||
$table->timestamps();
|
||||
$table->softDeletes()->comment('삭제일시(소프트삭제)');
|
||||
|
||||
$table->unique(['tenant_id', 'name'], 'uk_roles_tenant_name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('roles');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user