From 757042bdd2d1ee41b8668cf2adffd03c637543bd Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sun, 14 Jul 2024 19:57:37 +0200 Subject: [PATCH] Fix migrations --- ..._14_174642_create_formtemplates_mail_columns.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/database/migrations/2024_07_14_174642_create_formtemplates_mail_columns.php b/database/migrations/2024_07_14_174642_create_formtemplates_mail_columns.php index e700b0f6..8e84b26f 100644 --- a/database/migrations/2024_07_14_174642_create_formtemplates_mail_columns.php +++ b/database/migrations/2024_07_14_174642_create_formtemplates_mail_columns.php @@ -14,9 +14,9 @@ return new class extends Migration public function up() { Schema::table('forms', function (Blueprint $table) { - $table->json('description')->after('name')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->change(); - $table->json('mail_top')->after('name')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->change(); - $table->json('mail_bottom')->after('name')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->change(); + $table->json('description')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->change(); + $table->json('mail_top')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->nullable(false)->change(); + $table->json('mail_bottom')->default(json_encode(['time' => 4, 'blocks' => [], 'version' => '1.0']))->nullable(false)->change(); }); } @@ -27,9 +27,10 @@ return new class extends Migration */ public function down() { - Schema::table('formtemplates', function (Blueprint $table) { - $table->dropColumn('mail_top'); - $table->dropColumn('mail_bottom'); + Schema::table('forms', function (Blueprint $table) { + $table->json('description')->default(null)->change(); + $table->json('mail_top')->default(null)->nullable(true)->change(); + $table->json('mail_bottom')->default(null)->nullable(true)->change(); }); } };