initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
// Menghapus kolom obat lama karena sudah digantikan oleh tabel detail
|
||||
// Pastikan kolom ini memang ada sebelum dijalankan
|
||||
if (Schema::hasColumn('treatments', 'nama_obat')) {
|
||||
$table->dropColumn(['nama_obat', 'dosis', 'keterangan']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('treatments', function (Blueprint $table) {
|
||||
// Mengembalikan kolom jika rollback (opsional)
|
||||
$table->string('nama_obat')->nullable();
|
||||
$table->string('dosis')->nullable();
|
||||
$table->text('keterangan')->nullable();
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user