Migrating Migrations Table from CI3 for existing databases |
02-02-2023, 01:59 PM
(This post was last modified: 02-02-2023, 02:01 PM by objecttothis. Edit Reason: tag error )
The documentation gives update instructions in step 9 to run the migration in development after dropping the existing table then exporting the table to production and import the data. This works fine for new installs, but does nothing for people upgrading the WebApp from the previous version which was on CI3 to the new version which will be on CI4. What I (and I think anyone else converting an existing CI3 WebApp) need is a means to upgrade the CI3 migrations table to CI4 without losing the current migration version, since CI4 migrate re-running migrations that have already been run in a CI3 version of the webapp will likely break things.
I was able to generate the CI4 version of the table by renaming the CI3 table and running php spark migratetatus. From that I generated a script to modify the CI3 table to match the structure of the CI4 version. Code: ALTER TABLE `ospos_migrations` The problem is that if I run php spark migratetatus again, it doesn't see the existing version The above script leaves me with a single row containing: version 20210714140000 (this is the second to last migration) id 1 class NULL group NULL namespace App time 0 batch 0 Code: php spark migrate:status And of course it tries to run all the migrations when I run php spark migrate. CI3 migrations is much simpler, so I'm trying to figure out missing information. \App\Config\Migrations $timestampFormat is 'YmdHis_'
|
Messages In This Thread |
Migrating Migrations Table from CI3 for existing databases - by objecttothis - 02-02-2023, 01:59 PM
RE: Migrating Migrations Table from CI3 for existing databases - by kenjis - 02-02-2023, 05:24 PM
RE: Migrating Migrations Table from CI3 for existing databases - by objecttothis - 02-02-2023, 10:55 PM
RE: Migrating Migrations Table from CI3 for existing databases - by kenjis - 02-02-2023, 11:16 PM
RE: Migrating Migrations Table from CI3 for existing databases - by objecttothis - 02-02-2023, 11:24 PM
RE: Migrating Migrations Table from CI3 for existing databases - by kenjis - 02-03-2023, 12:50 AM
RE: Migrating Migrations Table from CI3 for existing databases - by objecttothis - 02-03-2023, 12:57 AM
RE: Migrating Migrations Table from CI3 for existing databases - by kenjis - 02-03-2023, 12:44 AM
|