parfum/database/migrations/2025_10_02_020223_create_bottles_table.php
Yoga Pangestu 4c43729299 feat(bottle): crud botol
-menambahkan skema model dan migrsai
-menyesuaikan relasi
2025-10-02 09:34:56 +07:00

35 lines
880 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('bottles', function (Blueprint $table) {
$table->id();
$table->string('name', 50);
$table->string('slug', 70)->unique();
$table->unsignedInteger('size');
$table->unsignedInteger('cost_price')->default(0);
$table->unsignedInteger('sale_price')->default(0);
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('bottles');
}
};