From bb4b14e49c71c0880f9b6f3ce2f76d92d03f9531 Mon Sep 17 00:00:00 2001 From: Samuel De Backer Date: Mon, 25 Aug 2014 23:26:17 +0200 Subject: [PATCH] Client import, create invoice with STRICT_TRANS_TABLE --- ...11_05_180133_confide_setup_users_table.php | 66 +++++++++---------- .../2014_04_17_145108_add_custom_fields.php | 4 +- .../2014_05_17_175626_add_quotes.php | 2 +- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php index e0411ca525fa..a5d50635c8c4 100755 --- a/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php +++ b/app/database/migrations/2013_11_05_180133_confide_setup_users_table.php @@ -235,23 +235,23 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('name'); - $t->string('address1'); - $t->string('address2'); - $t->string('city'); - $t->string('state'); - $t->string('postal_code'); + $t->string('name')->nullable(); + $t->string('address1')->nullable(); + $t->string('address2')->nullable(); + $t->string('city')->nullable(); + $t->string('state')->nullable(); + $t->string('postal_code')->nullable(); $t->unsignedInteger('country_id')->nullable(); - $t->string('work_phone'); - $t->text('private_notes'); - $t->decimal('balance', 13, 2); - $t->decimal('paid_to_date', 13, 2); + $t->string('work_phone')->nullable(); + $t->text('private_notes')->nullable(); + $t->decimal('balance', 13, 2)->nullable(); + $t->decimal('paid_to_date', 13, 2)->nullable(); $t->timestamp('last_login')->nullable(); - $t->string('website'); + $t->string('website')->nullable(); $t->unsignedInteger('industry_id')->nullable(); $t->unsignedInteger('size_id')->nullable(); - $t->boolean('is_deleted'); - $t->integer('payment_terms'); + $t->boolean('is_deleted')->default(false); + $t->integer('payment_terms')->nullable(); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); @@ -273,18 +273,18 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_primary'); - $t->boolean('send_invoice'); - $t->string('first_name'); - $t->string('last_name'); - $t->string('email'); - $t->string('phone'); + $t->boolean('is_primary')->default(0); + $t->boolean('send_invoice')->default(0); + $t->string('first_name')->nullable(); + $t->string('last_name')->nullable(); + $t->string('email')->nullable(); + $t->string('phone')->nullable(); $t->timestamp('last_login'); $t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); $t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');; - $t->unsignedInteger('public_id'); + $t->unsignedInteger('public_id')->nullable(); $t->unique( array('account_id','public_id') ); }); @@ -317,7 +317,7 @@ class ConfideSetupUsersTable extends Migration { $t->date('due_date')->nullable(); $t->text('terms'); $t->text('public_notes'); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->boolean('is_recurring'); $t->unsignedInteger('frequency_id'); $t->date('start_date')->nullable(); @@ -354,7 +354,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->string('transaction_reference'); + $t->string('transaction_reference')->nullable(); $t->timestamp('sent_date'); $t->timestamp('viewed_date'); @@ -445,7 +445,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->decimal('amount', 13, 2); $t->date('payment_date'); $t->string('transaction_reference'); @@ -472,7 +472,7 @@ class ConfideSetupUsersTable extends Migration { $t->timestamps(); $t->softDeletes(); - $t->boolean('is_deleted'); + $t->boolean('is_deleted')->default(false); $t->decimal('amount', 13, 2); $t->decimal('balance', 13, 2); $t->date('credit_date')->nullable(); @@ -495,17 +495,17 @@ class ConfideSetupUsersTable extends Migration { $t->unsignedInteger('account_id'); $t->unsignedInteger('client_id'); $t->unsignedInteger('user_id'); - $t->unsignedInteger('contact_id'); - $t->unsignedInteger('payment_id'); - $t->unsignedInteger('invoice_id'); - $t->unsignedInteger('credit_id'); - $t->unsignedInteger('invitation_id'); + $t->unsignedInteger('contact_id')->nullable(); + $t->unsignedInteger('payment_id')->nullable(); + $t->unsignedInteger('invoice_id')->nullable(); + $t->unsignedInteger('credit_id')->nullable(); + $t->unsignedInteger('invitation_id')->nullable(); - $t->text('message'); - $t->text('json_backup'); + $t->text('message')->nullable(); + $t->text('json_backup')->nullable(); $t->integer('activity_type_id'); - $t->decimal('adjustment', 13, 2); - $t->decimal('balance', 13, 2); + $t->decimal('adjustment', 13, 2)->nullable(); + $t->decimal('balance', 13, 2)->nullable(); $t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); $t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); diff --git a/app/database/migrations/2014_04_17_145108_add_custom_fields.php b/app/database/migrations/2014_04_17_145108_add_custom_fields.php index c6c1360823ae..f6ff7c8f45a1 100644 --- a/app/database/migrations/2014_04_17_145108_add_custom_fields.php +++ b/app/database/migrations/2014_04_17_145108_add_custom_fields.php @@ -26,8 +26,8 @@ class AddCustomFields extends Migration { Schema::table('clients', function($table) { - $table->string('custom_value1'); - $table->string('custom_value2'); + $table->string('custom_value1')->nullable(); + $table->string('custom_value2')->nullable(); }); } diff --git a/app/database/migrations/2014_05_17_175626_add_quotes.php b/app/database/migrations/2014_05_17_175626_add_quotes.php index 5079117d7ba2..6299ad124dc0 100644 --- a/app/database/migrations/2014_05_17_175626_add_quotes.php +++ b/app/database/migrations/2014_05_17_175626_add_quotes.php @@ -14,7 +14,7 @@ class AddQuotes extends Migration { { Schema::table('invoices', function($table) { - $table->boolean('is_quote'); + $table->boolean('is_quote')->default(0); $table->unsignedInteger('quote_id')->nullable(); $table->unsignedInteger('quote_invoice_id')->nullable(); });