R
R
runprogr2020-06-14 12:24:06
Laravel
runprogr, 2020-06-14 12:24:06

How to make a migration to production without affecting the database rows?

Created another migration file that adds a column to the db table. I do php artisan migrate on the local server, the last migration rolls, everything is fine. I do the same thing on the prod server, it rolls out the error "Base table or view already exists". That is, it runs the previous migration files, not just the latest one - the new one. How to deal with this, roll migrations and, most importantly, not lose data from the database

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vism, 2020-06-14
@vism

check the migrations table in the sales database and update it with data from the locale if anything

P
part_os, 2020-06-14
@part_os

Perhaps you just copied the dump to production without the migrations table, which stores the order in which migrations are performed. Create it and fill it in likeness from the local database.

S
segio_tt, 2020-06-14
@art055

Specify this file directly using --path=path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question