24 lines
685 B
PHP
24 lines
685 B
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class MigDeletePermohonanSeeder 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')->truncate();
|
|
DB::statement("ALTER TABLE permohonan AUTO_INCREMENT = 1");
|
|
// DB::table('permohonan')->delete();
|
|
// DB::statement("ALTER TABLE permohonan AUTO_INCREMENT = 1");
|
|
DB::statement('SET FOREIGN_KEY_CHECKS=1;'); // Aktifkan kembali FK
|
|
}
|
|
}
|