added reject & tanggal on meeting seminar
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('budget_control', function (Blueprint $table) {
|
||||
// Hapus foreign key jika sudah ada
|
||||
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_cabang_id_foreign');
|
||||
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_sender_id_foreign');
|
||||
DB::statement('ALTER TABLE budget_control DROP FOREIGN KEY IF EXISTS budget_control_receiver_id_foreign');
|
||||
|
||||
// Tambahkan foreign key dengan ON DELETE CASCADE
|
||||
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_cabang_id_foreign FOREIGN KEY (cabang_id) REFERENCES cabang(id) ON DELETE CASCADE');
|
||||
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_sender_id_foreign FOREIGN KEY (sender_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||
DB::statement('ALTER TABLE budget_control ADD CONSTRAINT budget_control_receiver_id_foreign FOREIGN KEY (receiver_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('budget_control', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('budget_control_log', function (Blueprint $table) {
|
||||
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_cabang_id_foreign');
|
||||
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_sender_id_foreign');
|
||||
DB::statement('ALTER TABLE budget_control_log DROP FOREIGN KEY IF EXISTS budget_control_log_receiver_id_foreign');
|
||||
|
||||
// Tambahkan foreign key dengan ON DELETE CASCADE
|
||||
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_cabang_id_foreign FOREIGN KEY (cabang_id) REFERENCES cabang(id) ON DELETE CASCADE');
|
||||
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_sender_id_foreign FOREIGN KEY (sender_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||
DB::statement('ALTER TABLE budget_control_log ADD CONSTRAINT budget_control_log_receiver_id_foreign FOREIGN KEY (receiver_id) REFERENCES admins(id) ON DELETE CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('budget_control_log', function (Blueprint $table) {
|
||||
//
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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::table('form_meeting_seminar', function (Blueprint $table) {
|
||||
$table->date('tanggal')->after('user_id');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('form_meeting_seminar', function (Blueprint $table) {
|
||||
$table->dropColumn('tanggal');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user