From beee71e4c31d036a674e13573e3a813590137aec Mon Sep 17 00:00:00 2001 From: Miguel N Date: Wed, 29 Apr 2020 21:56:41 +0100 Subject: [PATCH] Enforce data consistency --- .../migrations/2020_04_29_022245_create_profiles_table.php | 2 +- .../2020_04_29_022402_create_applications_table.php | 4 ++-- .../migrations/2020_04_29_022642_create_vacancies_table.php | 2 +- .../migrations/2020_04_29_030107_create_responses_table.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/database/migrations/2020_04_29_022245_create_profiles_table.php b/database/migrations/2020_04_29_022245_create_profiles_table.php index c8def1c..3d8339a 100644 --- a/database/migrations/2020_04_29_022245_create_profiles_table.php +++ b/database/migrations/2020_04_29_022245_create_profiles_table.php @@ -22,7 +22,7 @@ class CreateProfilesTable extends Migration 'gravatar' // Email profile ]); $table->text('socialLinks'); - $table->bigIncrements('userID'); + $table->bigInteger('userID')->unsigned(); $table->timestamps(); $table->foreign('userID')->references('id')->on('users')->onDelete('cascade'); diff --git a/database/migrations/2020_04_29_022402_create_applications_table.php b/database/migrations/2020_04_29_022402_create_applications_table.php index 0a69e3a..90b0483 100644 --- a/database/migrations/2020_04_29_022402_create_applications_table.php +++ b/database/migrations/2020_04_29_022402_create_applications_table.php @@ -20,8 +20,8 @@ class CreateApplicationsTable extends Migration */ Schema::create('applications', function (Blueprint $table) { $table->id(); - $table->bigIncrements('applicantUserID'); // 1-1 - $table->bigIncrements('applicantFormResponseID'); // 1-* + $table->bigInteger('applicantUserID')->unsigned(); // 1-1 + $table->bigInteger('applicantFormResponseID')->unsigned(); // 1-* $table->enum('applicationStatus', [ 'STAGE_SUBMITTED', 'STAGE_PEERAPPROVAL', diff --git a/database/migrations/2020_04_29_022642_create_vacancies_table.php b/database/migrations/2020_04_29_022642_create_vacancies_table.php index a2d8907..50480bc 100644 --- a/database/migrations/2020_04_29_022642_create_vacancies_table.php +++ b/database/migrations/2020_04_29_022642_create_vacancies_table.php @@ -19,7 +19,7 @@ class CreateVacanciesTable extends Migration $table->longText('vacancyDescription'); $table->string('permissionGroupName'); $table->string('discordRoleID'); - $table->bigIncrements('vacancyFormID'); + $table->bigInteger('vacancyFormID')->unsigned(); $table->integer('vacancyCount')->default(3); $table->timestamps(); }); diff --git a/database/migrations/2020_04_29_030107_create_responses_table.php b/database/migrations/2020_04_29_030107_create_responses_table.php index 83fe6bd..acd549d 100644 --- a/database/migrations/2020_04_29_030107_create_responses_table.php +++ b/database/migrations/2020_04_29_030107_create_responses_table.php @@ -15,7 +15,7 @@ class CreateResponsesTable extends Migration { Schema::create('responses', function (Blueprint $table) { $table->id(); - $table->bigIncrements('responseFormID'); + $table->bigInteger('responseFormID')->unsigned(); $table->longText('responseData'); $table->timestamps(); });