Visanduma / nova-two-factor

Laravel nova in-dashboard 2FA feature
54 stars 31 forks source link

migration failes on new version with foreign key constrain #28

Closed mrvnklm closed 1 year ago

mrvnklm commented 1 year ago

php artisan migrate and even php artisan migrate:fresh fail

  2023_03_01_093631_update_constraints_cascade_on_delete_on_two_fa ....................................................................... 29ms FAIL
[2023-03-24 10:57:24] local.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP FOREIGN KEY `nova_twofa_user_id_foreign`; check that it exists (SQL: alter table `nova_twofa` drop foreign key `nova_twofa_user_id_foreign`) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP FOREIGN KEY `nova_twofa_user_id_foreign`; check that it exists (SQL: alter table `nova_twofa` drop foreign key `nova_twofa_user_id_foreign`) at /Users/marvin/swim/portal/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)
[stacktrace]
lahirulhr commented 1 year ago

it may be column naming issue. you can publish the package migrations and update the foreign key constrain name. then try to migrate again.