Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 07c8c4f

Browse files
committed
Add unique to Uuid #34
1 parent 808b815 commit 07c8c4f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

database/migrations/2014_10_12_000000_create_users_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function up()
1616
Schema::create('users', function (Blueprint $table) {
1717
$table->increments('id');
1818
$table->string('name');
19-
$table->uuid('uuid');
19+
$table->uuid('uuid')->index()->unique();
2020
$table->string('email')->unique();
2121
$table->string('password');
2222
$table->rememberToken();

database/migrations/2017_02_09_031936_create_permission_tables.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public function up()
1919
$table->increments('id');
2020
$table->string('name');
2121
$table->string('guard_name');
22-
$table->uuid('uuid')->index();
22+
$table->uuid('uuid')->index()->unique();
2323
$table->timestamps();
2424
});
2525

2626
Schema::create($tableNames['roles'], function (Blueprint $table) {
2727
$table->increments('id');
2828
$table->string('name');
2929
$table->string('guard_name');
30-
$table->uuid('uuid')->index();
30+
$table->uuid('uuid')->index()->unique();
3131
$table->timestamps();
3232
});
3333

database/migrations/2017_08_08_193843_create_assets_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function up()
1616
Schema::create('assets', function (Blueprint $table) {
1717
$table->increments('id');
1818
$table->integer('user_id')->unsigned()->nullable();
19-
$table->uuid('uuid');
19+
$table->uuid('uuid')->index()->unique();
2020
$table->string('type', 45)->nullable();
2121
$table->string('path', 45)->nullable();
2222
$table->string('mime', 45)->nullable();

0 commit comments

Comments
 (0)