Welcome Guest, Not a member yet? Register   Sign In
Migrations - very confusing
#6

If I rename 001_do_step1.php to 001_do_step1.txt, it works.
Your example still generated the "duplicate field" error, because it calls $this->migration->currunt() twice!
I've got it working now with this code:
PHP Code:
    public function do_migrate()
    {
        
$version $this->migration->current();
        if (! 
$version) {
            
show_error($this->migration->error_string());
            exit;            
        }
        echo 
'Migration ' $version ' successful';
    } 

I'm still wondering how to do a roll-back. Each migration file has an "up" method and a "down" method. When is the "up" method called?
Reply


Messages In This Thread
Migrations - very confusing - by Wouter60 - 02-05-2016, 08:53 AM
RE: Migrations - very confusing - by keulu - 02-05-2016, 09:03 AM
RE: Migrations - very confusing - by Wouter60 - 02-05-2016, 09:17 AM
RE: Migrations - very confusing - by keulu - 02-05-2016, 09:23 AM
RE: Migrations - very confusing - by keulu - 02-05-2016, 09:24 AM
RE: Migrations - very confusing - by Wouter60 - 02-05-2016, 02:21 PM
RE: Migrations - very confusing - by siburny - 02-09-2016, 03:35 PM
RE: Migrations - very confusing - by siburny - 02-09-2016, 03:40 PM
RE: Migrations - very confusing - by LexXx - 05-31-2016, 12:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB