Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Foreign keys reference in migrations #403

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update 2014_10_28_180224_create_participants_table.php
  • Loading branch information
TasneemWahdan authored Mar 17, 2024
commit 76d54d456b0fe7526a03d98c59fa172da031e629
4 changes: 3 additions & 1 deletion migrations/2014_10_28_180224_create_participants_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public function up()
Schema::create(Models::table('participants'), function (Blueprint $table) {
$table->increments('id');
$table->integer('thread_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->foreign('thread_id')->references('id')->on('threads');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->timestamp('last_read')->nullable();
$table->timestamps();
});
Expand Down
Loading