Initial Commit
This commit is contained in:
21
database/seeders/MigDeletePermohonanHistoriesSeeder.php
Normal file
21
database/seeders/MigDeletePermohonanHistoriesSeeder.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class MigDeletePermohonanHistoriesSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=0;'); // Nonaktifkan constraint FK sementara
|
||||
DB::table('permohonan_histories')->truncate();
|
||||
DB::statement("ALTER TABLE permohonan_histories AUTO_INCREMENT = 1");
|
||||
DB::statement('SET FOREIGN_KEY_CHECKS=1;'); // Aktifkan kembali FK
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user