Files
sam-api/database/migrations/2025_07_26_051643_create_plans_table.php
kent b436b635c2 fix : 테이블 추가 및 수정 신규로 작성 (generator 설치)
composer require --dev kitloong/laravel-migrations-generator
php artisan migrate:generate
2025-07-26 05:22:58 +09:00

36 lines
1.1 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('plans', function (Blueprint $table) {
$table->bigIncrements('id')->comment('PK');
$table->string('name')->comment('플랜명');
$table->string('code', 30)->unique()->comment('플랜 코드');
$table->text('description')->nullable()->comment('설명');
$table->decimal('price', 12)->comment('월 요금');
$table->string('billing_cycle', 20)->default('monthly')->comment('청구 주기');
$table->json('features')->nullable()->comment('제공 기능/제한사항');
$table->boolean('is_active')->default(true)->comment('사용여부');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('plans');
}
};