first
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('questionnaire_questions', function (Blueprint $table) {
|
||||
$table->foreignId('parent_id')
|
||||
->nullable()
|
||||
->after('questionnaire_set_id')
|
||||
->constrained('questionnaire_questions')
|
||||
->cascadeOnDelete();
|
||||
|
||||
$table->json('rating_labels')->nullable()->after('options_json');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('questionnaire_questions', function (Blueprint $table) {
|
||||
$table->dropForeign(['parent_id']);
|
||||
$table->dropColumn(['parent_id', 'rating_labels']);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
DB::statement("ALTER TABLE questionnaire_questions MODIFY COLUMN question_type ENUM('tajuk','rating','single_choice','multiple_choice','short_text','long_text') NOT NULL");
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
DB::statement("ALTER TABLE questionnaire_questions MODIFY COLUMN question_type ENUM('rating','single_choice','multiple_choice','short_text','long_text') NOT NULL");
|
||||
}
|
||||
};
|
||||
@@ -11,14 +11,14 @@ class AdminSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
User::firstOrCreate(
|
||||
['email' => 'admin@mbip.gov.my'],
|
||||
['email' => 'saufi@mbip.gov.my'],
|
||||
[
|
||||
'name' => 'Admin eCert MBIP',
|
||||
'password' => Hash::make('Admin@MBIP2025!'),
|
||||
'password' => Hash::make('YongTauFu26'),
|
||||
'role' => 'super_admin',
|
||||
]
|
||||
);
|
||||
|
||||
$this->command->info('Admin account created: admin@mbip.gov.my / Admin@MBIP2025!');
|
||||
$this->command->info('Admin account created: saufi@mbip.gov.my / YongTauFu26');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user