Fix for down migrations

This commit is contained in:
Hillel Coren 2017-04-06 21:42:57 +03:00
parent 469ceee02e
commit bad2feaafd
2 changed files with 22 additions and 18 deletions

View File

@ -25,10 +25,12 @@ class AddEmailTemplates extends Migration
*/
public function down()
{
Schema::table('accounts', function ($table) {
$table->dropColumn('email_template_invoice');
$table->dropColumn('email_template_quote');
$table->dropColumn('email_template_payment');
});
if (Schema::hasColumn('accounts', 'email_template_invoice')) {
Schema::table('accounts', function ($table) {
$table->dropColumn('email_template_invoice');
$table->dropColumn('email_template_quote');
$table->dropColumn('email_template_payment');
});
}
}
}

View File

@ -42,22 +42,24 @@ class AddReminderEmails extends Migration
public function down()
{
Schema::table('accounts', function ($table) {
$table->dropColumn('email_subject_invoice');
$table->dropColumn('email_subject_quote');
$table->dropColumn('email_subject_payment');
$table->dropColumn('email_subject_reminder1');
$table->dropColumn('email_subject_reminder2');
$table->dropColumn('email_subject_reminder3');
$table->dropColumn('email_template_reminder1');
$table->dropColumn('email_template_reminder2');
$table->dropColumn('email_template_reminder3');
if (Schema::hasColumn('accounts', 'email_subject_invoice')) {
$table->dropColumn('email_subject_invoice');
$table->dropColumn('email_subject_quote');
$table->dropColumn('email_subject_payment');
$table->dropColumn('email_subject_reminder1');
$table->dropColumn('email_subject_reminder2');
$table->dropColumn('email_subject_reminder3');
$table->dropColumn('email_template_reminder1');
$table->dropColumn('email_template_reminder2');
$table->dropColumn('email_template_reminder3');
}
$table->dropColumn('enable_reminder1');
$table->dropColumn('enable_reminder2');
$table->dropColumn('enable_reminder3');
$table->dropColumn('num_days_reminder1');
$table->dropColumn('num_days_reminder2');
$table->dropColumn('num_days_reminder3');