Skip to content

Commit 5c9f77d

Browse files
committed
Add user_id field
1 parent c496329 commit 5c9f77d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
class AddUserIdToUrls extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('shorturl_urls', function (Blueprint $table) {
17+
$table->integer('user_id')->nullable()->unsigned()->after('expires_at');
18+
$table->foreign('user_id')->references('id')->on('users');
19+
});
20+
}
21+
}

0 commit comments

Comments
 (0)