parfum/database/migrations/2025_09_24_141358_create_memberships_table.php
Yoga Pangestu b53e873bb8 feat(membership): mengurtkan fiield di migrasi
-membuat seeder dan mendaftarkannya di database seeder
-membuat factrory untuk keperluan testing
-membuat feature test
2025-09-25 19:54:03 +07:00

33 lines
783 B
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('memberships', function (Blueprint $table) {
$table->id();
$table->string('name', 50);
$table->unsignedInteger('min_purchase');
$table->decimal('discount_percentage', 5, 2);
$table->text('terms_conditions')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('memberships');
}
};