Skip to content

Commit 6a0d91c

Browse files
feat(database): Update type column in config table
1 parent ffd624e commit 6a0d91c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

database/migrations/2024_02_29_111020_update_type_column_in_config_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\DB;
56
use Illuminate\Support\Facades\Schema;
67

78
class UpdateTypeColumnInConfigTable extends Migration
@@ -14,7 +15,7 @@ class UpdateTypeColumnInConfigTable extends Migration
1415
public function up(): void
1516
{
1617
Schema::table(config('laravel-config.table'), function (Blueprint $table) {
17-
$table->string('type')->nullable(false)->default('boolean')->change();
18+
DB::statement("ALTER TABLE laravel_config CHANGE type type varchar(255) DEFAULT 'boolean' NOT NULL");
1819
});
1920
}
2021

@@ -26,7 +27,7 @@ public function up(): void
2627
public function down(): void
2728
{
2829
Schema::table(config('laravel-config.table'), function (Blueprint $table) {
29-
$table->enum('type', ['boolean', 'text'])->nullable()->default('boolean')->change();
30+
DB::statement("ALTER TABLE laravel_config CHANGE type type ENUM('boolean','text') DEFAULT 'boolean' NOT NULL ");
3031
});
3132
}
3233
}

0 commit comments

Comments
 (0)