Skip to content

Commit 4332580

Browse files
committed
create personal_access_tokens table if not exists
1 parent 076fe52 commit 4332580

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

database/migrations/1_create_users_table.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@ public function up(): void
2222
$table->timestamps();
2323
});
2424

25+
if (!Schema::hasTable('personal_access_tokens')) {
26+
Schema::create('personal_access_tokens', function (Blueprint $table) {
27+
$table->id();
28+
$table->morphs('tokenable');
29+
$table->string('name');
30+
$table->string('token', 64)->unique();
31+
$table->text('abilities')->nullable();
32+
$table->timestamp('last_used_at')->nullable();
33+
$table->timestamp('expires_at')->nullable();
34+
$table->timestamps();
35+
});
36+
}
37+
2538
if (!Schema::hasTable('password_reset_tokens')) {
2639
Schema::create('password_reset_tokens', function (Blueprint $table) {
2740
$table->string('email')->primary();
@@ -48,6 +61,7 @@ public function up(): void
4861
public function down(): void
4962
{
5063
Schema::dropIfExists('users');
64+
Schema::dropIfExists('personal_access_tokens');
5165
Schema::dropIfExists('password_reset_tokens');
5266
Schema::dropIfExists('sessions');
5367
}

0 commit comments

Comments
 (0)