Files
sam-api/database/migrations/2025_07_26_051643_create_payments_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('payments', function (Blueprint $table) {
$table->bigIncrements('id')->comment('PK');
$table->unsignedBigInteger('subscription_id')->index('payments_subscription_id_foreign');
$table->decimal('amount', 12)->comment('결제금액');
$table->string('payment_method', 30)->comment('결제수단');
$table->string('transaction_id', 100)->nullable()->comment('PG 거래ID');
$table->dateTime('paid_at')->comment('결제일시');
$table->string('status', 20)->default('paid')->comment('결제상태(paid, failed 등)');
$table->text('memo')->nullable()->comment('비고');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('payments');
}
};