update hama dan penyakit
This commit is contained in:
@@ -12,26 +12,46 @@ return new class extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('map_lahan', function (Blueprint $table) {
|
||||
$table->jsonb('jenis_hama')->nullable();
|
||||
$table->jsonb('jenis_penyakit')->nullable();
|
||||
if (! Schema::hasColumn('map_lahan', 'jenis_hama')) {
|
||||
$table->jsonb('jenis_hama')->nullable();
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('map_lahan', 'jenis_penyakit')) {
|
||||
$table->jsonb('jenis_penyakit')->nullable();
|
||||
}
|
||||
});
|
||||
|
||||
Schema::table('map_tanaman', function (Blueprint $table) {
|
||||
$table->jsonb('jenis_hama')->nullable();
|
||||
$table->jsonb('jenis_penyakit')->nullable();
|
||||
if (! Schema::hasColumn('map_tanaman', 'jenis_hama')) {
|
||||
$table->jsonb('jenis_hama')->nullable();
|
||||
}
|
||||
|
||||
if (! Schema::hasColumn('map_tanaman', 'jenis_penyakit')) {
|
||||
$table->jsonb('jenis_penyakit')->nullable();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('map_lahan', function (Blueprint $table) {
|
||||
$table->dropColumn('jenis_hama');
|
||||
$table->dropColumn('jenis_penyakit');
|
||||
if (Schema::hasColumn('map_lahan', 'jenis_hama')) {
|
||||
$table->dropColumn('jenis_hama');
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('map_lahan', 'jenis_penyakit')) {
|
||||
$table->dropColumn('jenis_penyakit');
|
||||
}
|
||||
});
|
||||
|
||||
Schema::table('map_tanaman', function (Blueprint $table) {
|
||||
$table->dropColumn('jenis_hama');
|
||||
$table->dropColumn('jenis_penyakit');
|
||||
if (Schema::hasColumn('map_tanaman', 'jenis_hama')) {
|
||||
$table->dropColumn('jenis_hama');
|
||||
}
|
||||
|
||||
if (Schema::hasColumn('map_tanaman', 'jenis_penyakit')) {
|
||||
$table->dropColumn('jenis_penyakit');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user