composer require --dev kitloong/laravel-migrations-generator php artisan migrate:generate
36 lines
1.1 KiB
PHP
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');
|
|
}
|
|
};
|