Enforce data consistency

This commit is contained in:
Miguel Nogueira 2020-04-29 21:56:41 +01:00
parent f514c4f848
commit beee71e4c3
4 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ class CreateProfilesTable extends Migration
'gravatar' // Email profile 'gravatar' // Email profile
]); ]);
$table->text('socialLinks'); $table->text('socialLinks');
$table->bigIncrements('userID'); $table->bigInteger('userID')->unsigned();
$table->timestamps(); $table->timestamps();
$table->foreign('userID')->references('id')->on('users')->onDelete('cascade'); $table->foreign('userID')->references('id')->on('users')->onDelete('cascade');

View File

@ -20,8 +20,8 @@ class CreateApplicationsTable extends Migration
*/ */
Schema::create('applications', function (Blueprint $table) { Schema::create('applications', function (Blueprint $table) {
$table->id(); $table->id();
$table->bigIncrements('applicantUserID'); // 1-1 $table->bigInteger('applicantUserID')->unsigned(); // 1-1
$table->bigIncrements('applicantFormResponseID'); // 1-* $table->bigInteger('applicantFormResponseID')->unsigned(); // 1-*
$table->enum('applicationStatus', [ $table->enum('applicationStatus', [
'STAGE_SUBMITTED', 'STAGE_SUBMITTED',
'STAGE_PEERAPPROVAL', 'STAGE_PEERAPPROVAL',

View File

@ -19,7 +19,7 @@ class CreateVacanciesTable extends Migration
$table->longText('vacancyDescription'); $table->longText('vacancyDescription');
$table->string('permissionGroupName'); $table->string('permissionGroupName');
$table->string('discordRoleID'); $table->string('discordRoleID');
$table->bigIncrements('vacancyFormID'); $table->bigInteger('vacancyFormID')->unsigned();
$table->integer('vacancyCount')->default(3); $table->integer('vacancyCount')->default(3);
$table->timestamps(); $table->timestamps();
}); });

View File

@ -15,7 +15,7 @@ class CreateResponsesTable extends Migration
{ {
Schema::create('responses', function (Blueprint $table) { Schema::create('responses', function (Blueprint $table) {
$table->id(); $table->id();
$table->bigIncrements('responseFormID'); $table->bigInteger('responseFormID')->unsigned();
$table->longText('responseData'); $table->longText('responseData');
$table->timestamps(); $table->timestamps();
}); });