Closed pboese closed 2 years ago
The only working solution I can come up with would be to create a migration that runs before the others and inserts the newly created migrations into the migrations
table so they don't run
Hello @pboese
(SQLSTATE[42S01]: Base table or view already exists)
If you run php artisan migrate
in the existing schema, without migrations
table, Laravel will assume it is a fresh run and try to create schema from migration files, which explains the error.
To fix that, you need some manual work:
php artisan migrate:generate
yes
for being asked Do you want to log these migrations in the migrations table?
migrations
table with its records into your remote server.Above steps should fix your issue.
Heya and thanks for this awesome piece of code!
We have one issue: We're using Laravel Forge or Deployer (both pull the code from a git repo on the remote server) in our projects and this leads to errors when we ran the migrations generator locally, commit and push the changes and then deploy.
Because the remote server does not have the locally generated entries for the new migrations in the
migrations
table, the required php artisan migrate command fails (SQLSTATE[42S01]: Base table or view already exists
).Any idea how to work around this issue?
Thanks in advance!
Pelle