You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure why Santum doesn't let users publish migration files to database/migrations like other composer packages. The migration should be done by the Artisan Migrate command instead of pre-built in runsMigrations = true.
I'd recommend removing the default migration file named create_personal_access_tokens_table.php from Laravel and publishing it via Sanctum.
Or set the runsMigrations = false by default. Leaving the migration command to Laravel.
Actually, I'd like to submit a PR to fix this, but I'm not sure if it's the right thing to do, so I submit an issue to discuss it first.
Steps To Reproduce
1, php artisan make:migration version_1_0_0.
2, Moving all migration commands from pre-defined migration files to verison_1_0_0.
3, Deleted all pre-defined migration files in Laravel.
4, php artisan migrate then throwing exception like:
SQLSTATE[HY000]: General error: 1 table "personal_access_tokens" already exists (Connection: sqlite, SQL: create table "personal_access_tokens" ("id" integer primary key autoincrement not null, "tokenable_type" varchar not null, "tokenable_id" integer not null, "name" varchar not null, "token" varchar not null, "abilities" text, "last_used_at" datetime, "expires_at" datetime, "created_at" datetime, "updated_at" datetime))
The text was updated successfully, but these errors were encountered:
Sanctum Version
3.3.3
Laravel Version
10.39.0
PHP Version
8.3.1
Database Driver & Version
SQLite3 for macOS
Description
I'm not sure why Santum doesn't let users publish migration files to
database/migrations
like other composer packages. The migration should be done by the Artisan Migrate command instead of pre-built inrunsMigrations = true
.I'd recommend removing the default migration file named
create_personal_access_tokens_table.php
from Laravel and publishing it via Sanctum.Or set the
runsMigrations = false
by default. Leaving the migration command to Laravel.Actually, I'd like to submit a PR to fix this, but I'm not sure if it's the right thing to do, so I submit an issue to discuss it first.
Steps To Reproduce
1,
php artisan make:migration version_1_0_0
.2, Moving all migration commands from pre-defined migration files to verison_1_0_0.
3, Deleted all pre-defined migration files in Laravel.
4,
php artisan migrate
then throwing exception like:The text was updated successfully, but these errors were encountered: