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

I'm working on a library whose goal is to be plug-and-play, zero conf, whatever you want to call it. CI4 has made this *great* with name spacing everything and PSR4 autoload. My question is about the best practice around database migrations/seeds that come with a library.
The typical way I'd handle a table would be to create the migration and run it from CLI. However, CI4 has the ability to run migrations from a controller or library (https://codeigniter4.github.io/CodeIgnit...ge-example), which makes it appealing to offer "automatic database configuration" - maybe the constructor checks for the existence of the table and runs the migrations if not found.

How do autoloaded Composer packages typically handled migrations? is there an expectation that the user will run it from CLI - every time there's an update / new migration? Can a package pass its own [namespace]/Config/Migrations.php and load it to the migrations service? if so is it customary to use the default "migrations" table? Anyone with experience in the area care to weigh in?
Reply


Messages In This Thread
Third Party Migrations - by MGatner - 03-19-2019, 01:15 PM
RE: Third Party Migrations - by kilishan - 03-19-2019, 02:16 PM
RE: Third Party Migrations - by MGatner - 03-19-2019, 06:38 PM
RE: Third Party Migrations - by kilishan - 03-19-2019, 07:30 PM
RE: Third Party Migrations - by MGatner - 03-20-2019, 05:14 AM
RE: Third Party Migrations - by kilishan - 03-20-2019, 07:30 AM
RE: Third Party Migrations - by MGatner - 03-21-2019, 01:44 PM
RE: Third Party Migrations - by kilishan - 03-21-2019, 09:03 PM
RE: Third Party Migrations - by MGatner - 03-22-2019, 07:20 AM
RE: Third Party Migrations - by MGatner - 03-22-2019, 12:31 PM
RE: Third Party Migrations - by MGatner - 03-22-2019, 12:36 PM
RE: Third Party Migrations - by kilishan - 03-22-2019, 12:55 PM
RE: Third Party Migrations - by MGatner - 03-26-2019, 03:22 AM
RE: Third Party Migrations - by blaasvaer - 09-10-2020, 04:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB