Welcome Guest, Not a member yet? Register   Sign In
Migrations Question
#1

I have used Migrations in other development environments but we never used it in CI3.  So I have a large project that we now see not using migrations was dumb on our part.  Can we start using migrations now and we can code them as we need going forward?  So if I update a database I can just create a migration for it and others can run it?
Thanks
Reply
#2

Yes, you can.

Export the current database, and create the first migration file to create the current all tables.
Reply
#3

(03-11-2024, 09:29 PM)kenjis Wrote: Yes, you can.

Export the current database, and create the first migration file to create the current all tables.

Ok great, we will give that a try.  Will that affect the data in the system?
Reply
#4

Ah, you also need to prepare the migration table in the production environment.

        (development) Run the migration in the development environment or so with brand new database, to create the new migration table.
        (development) Export the migration table.
        (production) Import the new migration table and the data.

In production, the first migration should not run, so you need to set data that shows it is done already to the migration table in production.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB