Fix problem updating

This commit is contained in:
Hillel Coren 2016-08-13 22:21:44 +03:00
parent ce2c71843c
commit c2e5907dfe
2 changed files with 9 additions and 10 deletions

View File

@ -17,16 +17,16 @@ class AddPageSize extends Migration
$table->boolean('live_preview')->default(true); $table->boolean('live_preview')->default(true);
$table->smallInteger('invoice_number_padding')->default(4); $table->smallInteger('invoice_number_padding')->default(4);
}); });
Schema::table('fonts', function ($table) { Schema::table('fonts', function ($table) {
$table->dropColumn('is_early_access'); $table->dropColumn('is_early_access');
}); });
Schema::create('expense_categories', function($table) Schema::create('expense_categories', function($table)
{ {
$table->increments('id'); $table->increments('id');
$table->unsignedInteger('user_id'); $table->unsignedInteger('user_id');
$table->unsignedInteger('account_id')->index(); $table->unsignedInteger('account_id')->index();
$table->timestamps(); $table->timestamps();
$table->softDeletes(); $table->softDeletes();
@ -34,15 +34,14 @@ class AddPageSize extends Migration
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unsignedInteger('public_id')->index(); $table->unsignedInteger('public_id')->index();
$table->unique( array('account_id','public_id') ); $table->unique( array('account_id','public_id') );
}); });
Schema::table('expenses', function ($table) { Schema::table('expenses', function ($table) {
$table->unsignedInteger('expense_category_id')->nullable()->index(); $table->unsignedInteger('expense_category_id')->nullable()->index();
//$table->foreign('expense_category_id')->references('id')->on('expense_categories')->onDelete('cascade');
$table->foreign('expense_category_id')->references('id')->on('expense_categories')->onDelete('cascade');
}); });
} }
@ -62,12 +61,12 @@ class AddPageSize extends Migration
Schema::table('fonts', function ($table) { Schema::table('fonts', function ($table) {
$table->boolean('is_early_access'); $table->boolean('is_early_access');
}); });
Schema::table('expenses', function ($table) { Schema::table('expenses', function ($table) {
$table->dropForeign('expenses_expense_category_id_foreign'); $table->dropForeign('expenses_expense_category_id_foreign');
$table->dropColumn('expense_category_id'); $table->dropColumn('expense_category_id');
}); });
Schema::dropIfExists('expense_categories'); Schema::dropIfExists('expense_categories');
} }
} }

View File

@ -88,7 +88,7 @@ class PaymentsChanges extends Migration
$table->string('email')->nullable(); $table->string('email')->nullable();
$table->unsignedInteger('payment_method_id')->nullable(); $table->unsignedInteger('payment_method_id')->nullable();
$table->foreign('payment_method_id')->references('id')->on('payment_methods'); //$table->foreign('payment_method_id')->references('id')->on('payment_methods');
}); });
Schema::table('invoices', function($table) Schema::table('invoices', function($table)