From 9e39f42aa85fee1a7e85d77ea842f2eaaa4ece1c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 9 Mar 2020 20:45:59 +1100 Subject: [PATCH] Remove JSON types (#3457) * Remove backup column from schema * Add slack webhooks to company user table * Preview route * remove json column from company gateway * fixes for testS * Fixes for typos * Remove json types --- .../2014_10_13_000000_create_users_table.php | 21 +++++++++---------- tests/Feature/UserTest.php | 3 ++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/database/migrations/2014_10_13_000000_create_users_table.php b/database/migrations/2014_10_13_000000_create_users_table.php index 826600c2527a..b51133476a21 100644 --- a/database/migrations/2014_10_13_000000_create_users_table.php +++ b/database/migrations/2014_10_13_000000_create_users_table.php @@ -198,9 +198,9 @@ class CreateUsersTable extends Migration $table->unsignedInteger('company_id'); $table->unsignedInteger('account_id'); $table->unsignedInteger('user_id')->index(); - $table->json('permissions')->nullable(); - $table->json('notifications')->nullable(); - $table->json('settings')->nullable(); + $table->mediumText('permissions')->nullable(); + $table->mediumText('notifications')->nullable(); + $table->mediumText('settings')->nullable(); $table->string('slack_webhook_url'); $table->boolean('is_owner')->default(false); $table->boolean('is_admin')->default(false); @@ -458,7 +458,7 @@ class CreateUsersTable extends Migration $t->boolean('is_deleted')->default(false); - $t->json('line_items')->nullable(); + $t->mediumText('line_items')->nullable(); $t->text('footer')->nullable(); $t->text('public_notes')->nullable(); $t->text('private_notes')->nullable(); @@ -533,8 +533,7 @@ class CreateUsersTable extends Migration $t->datetime('due_date')->nullable(); $t->boolean('is_deleted')->default(false); - - $t->json('line_items')->nullable(); + $t->mediumText('line_items')->nullable(); $t->text('footer')->nullable(); $t->text('public_notes')->nullable(); $t->text('private_notes')->nullable(); @@ -637,8 +636,7 @@ class CreateUsersTable extends Migration $t->boolean('is_deleted')->default(false); - $t->json('line_items')->nullable(); - + $t->mediumText('line_items')->nullable(); $t->text('footer')->nullable(); $t->text('public_notes')->nullable(); $t->text('private_notes')->nullable(); @@ -703,7 +701,7 @@ class CreateUsersTable extends Migration $t->boolean('is_deleted')->default(false); - $t->json('line_items')->nullable(); + $t->mediumText('line_items')->nullable(); $t->text('footer')->nullable(); $t->text('public_notes')->nullable(); @@ -773,7 +771,8 @@ class CreateUsersTable extends Migration $t->boolean('is_deleted')->default(false); - $t->json('line_items')->nullable(); + $t->mediumText('line_items')->nullable(); + $t->text('footer')->nullable(); $t->text('public_notes')->nullable(); @@ -1101,7 +1100,7 @@ class CreateUsersTable extends Migration Schema::create('backups', function ($table) { $table->increments('id'); $table->unsignedInteger('activity_id'); - $table->json('json_backup')->nullable(); + $table->mediumText('json_backup')->nullable(); $table->longText('html_backup')->nullable(); $table->timestamps(6); diff --git a/tests/Feature/UserTest.php b/tests/Feature/UserTest.php index b77d384fce9b..74d25a31a541 100644 --- a/tests/Feature/UserTest.php +++ b/tests/Feature/UserTest.php @@ -191,7 +191,8 @@ class UserTest extends TestCase $arr = $response->json(); -\Log::error($arr['data']['company_user']['permissions']); +\Log::error($arr); +\Log::error(print_r($arr['data']['company_user'],1)); $this->assertNotNull($arr['data']['company_user']); $this->assertFalse($arr['data']['company_user']['is_admin']);