From 9ebe101ce464b5feb4ff10bae9fd8414f74cb822 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Sun, 25 Mar 2018 19:07:15 -0300 Subject: [PATCH] Use unsigned* columns --- .../2016_09_10_164406_create_jobs_table.php | 2 +- ...14_200815_add_facebook_columns_to_users_table.php | 2 +- .../2017_05_04_193252_alter_activity_nullable.php | 2 +- ...17_10_19_134816_create_activity_contact_table.php | 4 ++-- ...2017_11_10_174654_create_contact_fields_table.php | 12 ++++++------ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/database/migrations/2016_09_10_164406_create_jobs_table.php b/database/migrations/2016_09_10_164406_create_jobs_table.php index 9df88d36ae5..3f572349610 100644 --- a/database/migrations/2016_09_10_164406_create_jobs_table.php +++ b/database/migrations/2016_09_10_164406_create_jobs_table.php @@ -17,7 +17,7 @@ public function up() $table->bigIncrements('id'); $table->string('queue'); $table->longText('payload'); - $table->tinyInteger('attempts')->unsigned(); + $table->unsignedTinyInteger('attempts'); $table->unsignedInteger('reserved_at')->nullable(); $table->unsignedInteger('available_at'); $table->unsignedInteger('created_at'); diff --git a/database/migrations/2017_01_14_200815_add_facebook_columns_to_users_table.php b/database/migrations/2017_01_14_200815_add_facebook_columns_to_users_table.php index 8f5347501b1..35041235b8e 100644 --- a/database/migrations/2017_01_14_200815_add_facebook_columns_to_users_table.php +++ b/database/migrations/2017_01_14_200815_add_facebook_columns_to_users_table.php @@ -14,7 +14,7 @@ class AddFacebookColumnsToUsersTable extends Migration public function up() { Schema::table('users', function (Blueprint $table) { - $table->bigInteger('facebook_user_id')->unsigned()->index(); + $table->unsignedBigInteger('facebook_user_id')->index(); $table->string('access_token')->nullable(); }); } diff --git a/database/migrations/2017_05_04_193252_alter_activity_nullable.php b/database/migrations/2017_05_04_193252_alter_activity_nullable.php index 87a62086c83..c645ffbe1c0 100644 --- a/database/migrations/2017_05_04_193252_alter_activity_nullable.php +++ b/database/migrations/2017_05_04_193252_alter_activity_nullable.php @@ -14,7 +14,7 @@ class AlterActivityNullable extends Migration public function up() { Schema::table('activities', function (Blueprint $table) { - $table->integer('activity_type_id')->unsigned()->nullable()->change(); + $table->unsignedInteger('activity_type_id')->nullable()->change(); }); } } diff --git a/database/migrations/2017_10_19_134816_create_activity_contact_table.php b/database/migrations/2017_10_19_134816_create_activity_contact_table.php index 4f73ddf09c3..41225010994 100644 --- a/database/migrations/2017_10_19_134816_create_activity_contact_table.php +++ b/database/migrations/2017_10_19_134816_create_activity_contact_table.php @@ -14,8 +14,8 @@ class CreateActivityContactTable extends Migration public function up() { Schema::create('activity_contact', function (Blueprint $table) { - $table->integer('activity_id')->unsigned(); - $table->integer('contact_id')->unsigned(); + $table->unsignedInteger('activity_id'); + $table->unsignedInteger('contact_id'); $table->foreign('activity_id')->references('id')->on('activities')->onDelete('cascade'); $table->foreign('contact_id')->references('id')->on('contacts')->onDelete('cascade'); diff --git a/database/migrations/2017_11_10_174654_create_contact_fields_table.php b/database/migrations/2017_11_10_174654_create_contact_fields_table.php index 81a6588673b..fe45e2dd3d6 100644 --- a/database/migrations/2017_11_10_174654_create_contact_fields_table.php +++ b/database/migrations/2017_11_10_174654_create_contact_fields_table.php @@ -15,7 +15,7 @@ public function up() { Schema::create('contact_field_types', function (Blueprint $table) { $table->increments('id'); - $table->integer('account_id')->unsigned(); + $table->unsignedInteger('account_id'); $table->string('name'); $table->string('fontawesome_icon')->nullable(); $table->string('protocol')->nullable(); @@ -28,9 +28,9 @@ public function up() Schema::create('contact_fields', function (Blueprint $table) { $table->increments('id'); - $table->integer('account_id')->unsigned(); - $table->integer('contact_id')->unsigned(); - $table->integer('contact_field_type_id')->unsigned(); + $table->unsignedInteger('account_id'); + $table->unsignedInteger('contact_id'); + $table->unsignedInteger('contact_field_type_id'); $table->string('data'); $table->timestamps(); @@ -41,8 +41,8 @@ public function up() Schema::create('addresses', function (Blueprint $table) { $table->increments('id'); - $table->integer('account_id')->unsigned(); - $table->integer('contact_id')->unsigned(); + $table->unsignedInteger('account_id'); + $table->unsignedInteger('contact_id'); $table->string('name')->nullable(); $table->string('street')->nullable(); $table->string('city')->nullable();