Welcome Guest, Not a member yet? Register   Sign In
Migrating Migrations Table from CI3 for existing databases
#5

(This post was last modified: 02-02-2023, 11:30 PM by objecttothis.)

(02-02-2023, 11:16 PM)kenjis Wrote:
(02-02-2023, 10:55 PM)objecttothis Wrote: Following the current upgrade procedure starts migrations over, so it will re-run migrations 1-5.

No, don't run migrations again in the production server.

You just run all migrations 1-5 in a new development server,
and export the migration table in the development server
and import it to the production server.

If we were talking about a single installation, then what you're saying would be fine. This is going into opensource software where we can't just have each user of the webapp spin up a development server, run migrations, then import to production. Even if we could, migrations would fail on the development copy of the production database for the same reason I described. The migrations I'm talking about from versions of the webapp prior to the CI4 changeover are not just database table structure changes. Some of them are data correction changes, so the migrations require the production data in order to work.

Further, one user might be migrating from 1.0 of the webapp while another might be migrating from 1.0.12, so people will be at different points in the migration when they go to version 1.1 which is on CI4. This is why the 1.1 version of the webapp (on CI4) needs to start from where the previous CI3 migrations version number left off.

I think I might understand what you mean now... If, on my dev box, I start from a clean install of the webapp, then run migrations against it so that it does all the migrations, I can then export that table and create a script which will need to run before the first CI4 migration and import all the rows up to the CI3 version on that install, then run migrations... that could work. I wish it was less complicated though. It would be nicer if migrate recognized the version number from CI3 migrations and didn't try to run migrations before that.
Reply


Messages In This Thread
RE: Migrating Migrations Table from CI3 for existing databases - by objecttothis - 02-02-2023, 11:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB