Files
ilycats/database/migrations/2026_01_22_004020_create_treatments_table.php
2026-02-08 15:16:35 +07:00

35 lines
818 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('treatments', function (Blueprint $table) {
$table->id();
$table->foreignId('cat_id')->constrained()->onDelete('cascade'); // Relasi ke tabel cats
$table->date('tanggal');
$table->string('keluhan');
$table->string('nama_obat');
$table->string('dosis');
$table->text('keterangan')->nullable();
$table->string('foto_bukti')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('treatments');
}
};