laravel-achievements icon indicating copy to clipboard operation
laravel-achievements copied to clipboard

Foreign key in achievement_progress table has incorrect column type

Open mstralka opened this issue 2 years ago • 0 comments

In a MySQL database, the id field type in the achievement_details table is UNSIGNED BIG INT because the $table->id(); command generates an unsigned big int field.

// This generates an UNSIGNED BIG INT column.
$table->id();

In the achievement_progress table, the achievement_id field is created as:

$table->unsignedInteger('achievement_id');

That causes a mismatch and MySQL won't create the foreign key.

It should be:

$table->unsignedBigInteger('achievement_id');

mstralka avatar Jul 25 '22 01:07 mstralka