Initial commit for combined ProjectKP
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
$app = require_once 'bootstrap/app.php';
|
||||
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
$kernel->bootstrap();
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
try {
|
||||
DB::statement("UPDATE users SET role='superadmin' WHERE role='super admin'");
|
||||
// Since 'user' is not yet in enum, we might need to add it first.
|
||||
DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('superadmin', 'admin', 'pegawai', 'user')");
|
||||
DB::statement("UPDATE users SET role='user' WHERE role='pegawai'");
|
||||
DB::statement("ALTER TABLE users MODIFY COLUMN role ENUM('superadmin', 'admin', 'user') DEFAULT 'user'");
|
||||
echo "Success altering table and migrating data.\n";
|
||||
} catch (\Exception $e) {
|
||||
echo "Error: " . $e->getMessage() . "\n";
|
||||
}
|
||||
Reference in New Issue
Block a user