Skip to content

Commit

Permalink
feat(database): Update type column in config table
Browse files Browse the repository at this point in the history
  • Loading branch information
YunusEmreNalbant committed Mar 7, 2024
1 parent ffd624e commit 6a0d91c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

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

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

0 comments on commit 6a0d91c

Please sign in to comment.