Initial commit: Struktur aplikasi ilycats
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?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
|
||||
{
|
||||
// Pastikan ini 'foods' (jamak), bukan 'food'
|
||||
Schema::create('foods', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('nama_makanan');
|
||||
$table->string('slug')->unique()->nullable();
|
||||
$table->integer('qty');
|
||||
$table->string('unit');
|
||||
$table->foreignId('category_id')->nullable()->constrained('categories')->onDelete('set null');
|
||||
$table->string('kategori')->default('Umum');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('foods');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user