phpmig
phpmig copied to clipboard
Can I rollback last migration?
I tried using down() method with version number but it's not work! I changed PhpmigApplication.php file
from
// down
} elseif ($to < $from && $version > $to && $version <= $from) {
$migrations[] = $path;
}
to
// down
} elseif ($to <= $from && $version => $to && $version <= $from) {
$migrations[] = $path;
}
Then, I call down() method with version number it's rollback last migration. Anyone here who can help me??
phpmig rollback
@davedevelopment thanks brother. But, I want to use API php mig application method from my custom console command. Can you give me some suggestion?
Not sure in that case I'm afraid, been a while since I dug around in this codebase. Perhaps just try looking in the RollbackCommand https://github.com/davedevelopment/phpmig/blob/c55d2f803d1242ce08742aa61e1b410802a00932/src/Phpmig/Console/Command/RollbackCommand.php ?
OK @davedevelopment I'll check it. And many many thanks for your nice project