Skip to content

Commit

Permalink
fix: ensure using custom user foreign key when create unique
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Sep 26, 2024
1 parent ee53d96 commit d5ef492
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrations/2024_09_23_163615_create_likes_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function up(): void
$table->morphs('model');
$table->string('type')->default('like');

$table->unique(['user_id', 'model_id', 'model_type', 'type'], 'unique_user_model_type_interaction');
$table->unique([config('like.users.foreign_key'), 'model_id', 'model_type', 'type'], 'unique_user_model_type_interaction');

$table->timestamps();
});
Expand Down

0 comments on commit d5ef492

Please sign in to comment.