Make MySQL Happy
MySQL complains when we try to change the rules column to json before we change the data... If we change the data, then change the column its happy. :)
This commit is contained in:
parent
49e93c1379
commit
8c64a4ad55
@ -12,13 +12,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('egg_variables', function (Blueprint $table) {
|
||||
$table->json('rules')->change();
|
||||
});
|
||||
|
||||
DB::table('egg_variables')->select(['id', 'rules'])->cursor()->each(function ($eggVariable) {
|
||||
DB::table('egg_variables')->where('id', $eggVariable->id)->update(['rules' => explode('|', $eggVariable->rules)]);
|
||||
});
|
||||
|
||||
Schema::table('egg_variables', function (Blueprint $table) {
|
||||
$table->json('rules')->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user