Migration fixes

This commit is contained in:
Hillel Coren 2018-05-03 07:37:02 +03:00
parent 44ee4e61c5
commit 31db51fc0c
3 changed files with 27 additions and 23 deletions

View File

@ -342,7 +342,7 @@ if (! defined('APP_NAME')) {
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'http://docs.invoiceninja.com/en/latest'));
define('NINJA_DATE', '2000-01-01');
define('NINJA_VERSION', '4.4.1' . env('NINJA_VERSION_SUFFIX'));
define('NINJA_VERSION', '4.4.2' . env('NINJA_VERSION_SUFFIX'));
define('NINJA_TERMS_VERSION', '');
define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'));

View File

@ -20,30 +20,34 @@ class AddSlackNotifications extends Migration
DB::statement('UPDATE activities SET client_id = NULL WHERE client_id = 0');
Schema::table('activities', function ($table) {
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
$table->index('payment_id');
});
if (! Schema::hasColumn('users', 'slack_webhook_url')) {
Schema::table('users', function ($table) {
$table->string('slack_webhook_url')->nullable();
$table->string('accepted_terms_version')->nullable();
$table->timestamp('accepted_terms_timestamp')->nullable();
$table->string('accepted_terms_ip')->nullable();
});
}
Schema::table('users', function ($table) {
$table->string('slack_webhook_url')->nullable();
$table->string('accepted_terms_version')->nullable();
$table->timestamp('accepted_terms_timestamp')->nullable();
$table->string('accepted_terms_ip')->nullable();
});
Schema::table('accounts', function ($table) {
$table->boolean('auto_archive_invoice')->default(false)->nullable();
$table->boolean('auto_archive_quote')->default(false)->nullable();
$table->boolean('auto_email_invoice')->default(true)->nullable();
$table->boolean('send_item_details')->default(false)->nullable();
});
Schema::table('expenses', function ($table) {
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
});
if (! Schema::hasColumn('accounts', 'auto_archive_invoice')) {
Schema::table('accounts', function ($table) {
$table->boolean('auto_archive_invoice')->default(false)->nullable();
$table->boolean('auto_archive_quote')->default(false)->nullable();
$table->boolean('auto_email_invoice')->default(true)->nullable();
$table->boolean('send_item_details')->default(false)->nullable();
});
}
try {
Schema::table('expenses', function ($table) {
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
});
Schema::table('activities', function ($table) {
$table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
$table->index('payment_id');
});
Schema::table('companies', function ($table) {
$table->dropForeign('companies_payment_id_foreign');
});

View File

@ -59,7 +59,7 @@ author = u'Invoice Ninja'
# The short X.Y version.
version = u'4.4'
# The full version, including alpha/beta/rc tags.
release = u'4.4.1'
release = u'4.4.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.