![]() |
Migration on group and namespace - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Migration on group and namespace (/showthread.php?tid=79608) |
Migration on group and namespace - superior - 07-07-2021 Hi, I'm trying to run a migration to my maindb group from my modules folder, to do this i've been reading the migration what command to use. This doesn't seem to be working and i'm wondering if it's something wrong on my side or someone has the same issue, below the coding for this and command i've used. PHP Code: <?php Code: php spark migrate -g maindb -n Modules Did someone encountered this issue or is it just me? RE: Migration on group and namespace - paliz - 07-07-2021 I see this problem too you need use - - namespace instead of - n It s work for me RE: Migration on group and namespace - superior - 07-07-2021 Hi paliz! thank you for your answer, did try your solution but it's looking for APPPATH and that's not my directory structure. My modules folder is outside of the app root, it doesn't return any errors when i use the userguide commands but nothing happens inside the query. RE: Migration on group and namespace - paliz - 07-07-2021 Use rootapp or rootpath RE: Migration on group and namespace - InsiteFX - 07-08-2021 If you want to know how to do this download Boilerplate by user @agungsugiarto Look at the folder Commands InstallCommand.php and PublishCommand.php He is re-writing the namespace form the module to the App Path. Download: CodeIgniter 4 Application Boilerplate RE: Migration on group and namespace - superior - 07-09-2021 @InsiteFX According to the documentation the -n is for the namespace, it seems like that isn't working correctly right now? RE: Migration on group and namespace - InsiteFX - 07-09-2021 I'll look into it and get back to you in a short. RE: Migration on group and namespace - ARAmiss - 10-18-2021 (07-08-2021, 01:22 AM)InsiteFX Wrote: If you want to know how to do this download Boilerplate by user @agungsugiarto I also had to write custom spark conmmand because it was not possible to run migrations this way: Code: migrate -g mygroup -n mynamespace I was getting an error: Code: Unable to connect to the database. RE: Migration on group and namespace - InsiteFX - 10-19-2021 If you change the folder paths then you need to edit the spark file and change the path in it also. Spark points to the public folder in the root. RE: Migration on group and namespace - ARAmiss - 10-19-2021 It is not very convenient to customize the default spark file in the root of the site in the case of using modules. But that's just my opinion. Therefore, I chose the option of adding custom command to the module itself. |