From ca6b5c9966c146de339bfd9fb0127e2b6222d834 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sat, 1 Apr 2017 23:49:48 +0300 Subject: [PATCH] Remove old fields before adding new fields --- ..._03_16_085702_add_gateway_fee_location.php | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php index 129b30439675..7752f70867dc 100644 --- a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php +++ b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php @@ -12,20 +12,6 @@ class AddGatewayFeeLocation extends Migration */ public function up() { - Schema::table('accounts', function ($table) { - if (Schema::hasColumn('accounts', 'auto_wrap')) { - $table->dropColumn('auto_wrap'); - } - if (Schema::hasColumn('accounts', 'utf8_invoices')) { - $table->dropColumn('utf8_invoices'); - } - if (Schema::hasColumn('accounts', 'dark_mode')) { - $table->dropColumn('dark_mode'); - } - $table->boolean('gateway_fee_enabled')->default(0); - $table->date('reset_counter_date')->nullable(); - }); - Schema::table('clients', function ($table) { $table->integer('invoice_number_counter')->default(1)->nullable(); $table->integer('quote_number_counter')->default(1)->nullable(); @@ -98,6 +84,7 @@ class AddGatewayFeeLocation extends Migration from accounts;'); Schema::table('accounts', function ($table) { + $table->dropColumn('bcc_email'); $table->dropColumn('email_subject_invoice'); $table->dropColumn('email_subject_quote'); $table->dropColumn('email_subject_payment'); @@ -110,6 +97,21 @@ class AddGatewayFeeLocation extends Migration $table->dropColumn('email_template_reminder1'); $table->dropColumn('email_template_reminder2'); $table->dropColumn('email_template_reminder3'); + + if (Schema::hasColumn('accounts', 'auto_wrap')) { + $table->dropColumn('auto_wrap'); + } + if (Schema::hasColumn('accounts', 'utf8_invoices')) { + $table->dropColumn('utf8_invoices'); + } + if (Schema::hasColumn('accounts', 'dark_mode')) { + $table->dropColumn('dark_mode'); + } + }); + + Schema::table('accounts', function ($table) { + $table->boolean('gateway_fee_enabled')->default(0); + $table->date('reset_counter_date')->nullable(); }); }