CodeIgniter Forums
problem with migrations - 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: problem with migrations (/showthread.php?tid=76362)



problem with migrations - midav - 05-06-2020

Hi everyone, there was a problem in the new version, or it was because it works from the console through SPAKE, but I try to start the migration through the controller, I do everything according to the documentation. And it says if you run
PHP Code:
$migrate->latest() 
then it will go through all the namespaces and will look for migrations and run them. But in fact, it doesn’t do this because I called
PHP Code:
$migrate->findMigrations () 
and it empty didn’t get there the way of these migrations. Only this way works
PHP Code:
$migrate->setNamespace('Myth \ Auth')->latest() 

(05-06-2020, 01:01 AM)midav Wrote: Hi everyone, there was a problem in the new version, or it was because it works from the console through SPAKE, but I try to start the migration through the controller, I do everything according to the documentation. And it says if you run
PHP Code:
$migrate->latest() 
then it will go through all the namespaces and will look for migrations and run them. But in fact, it doesn’t do this because I called
PHP Code:
$migrate->findMigrations () 
and it empty didn’t get there the way of these migrations. Only this way works
PHP Code:
$migrate->setNamespace('Myth \ Auth')->latest() 

all because of this check
PHP Code:
$namespaces $this->namespace ? [$this->namespace] : array_keys(Services::autoloader()->getNamespace()); 
because App gets into $this->namespace and everything and then doesn’t give us all namespace because $this->namespace exists