Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Migration.php #53

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Update Migration.php #53

merged 1 commit into from
Nov 21, 2024

Conversation

mattschlosser
Copy link
Contributor

Hi again,

I noticed an issue in v5 of the migraiton cli. When running vendor/bin/migrate down without a version number, it used to go all the way to zero, now it just shows Fatal error

Fatal error: Uncaught TypeError: ByJG\DbMigration\Migration::down(): Argument #1 ($upVersion) must be of type int, null given, called in /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/byjg/migration-cli/src/DownCommand.php on line 43 and defined in /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/byjg/migration/src/Migration.php:408
Stack trace:
#0 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/byjg/migration-cli/src/DownCommand.php(43): ByJG\DbMigration\Migration->down(NULL, true)
#1 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/symfony/console/Command/Command.php(279): ByJG\DbMigration\Console\DownCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/symfony/console/Application.php(1029): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/symfony/console/Application.php(316): Symfony\Component\Console\Application->doRunCommand(Object(ByJG\DbMigration\Console\DownCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/byjg/migration-cli/scripts/migrate(23): Symfony\Component\Console\Application->run()
#6 /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/bin/migrate(119): include('/builds/pMYRyEF...')
#7 {main}
  thrown in /builds/pMYRyEFjS/0/prosper/prosperlms/vendor/byjg/migration/src/Migration.php on line 408

Added null as an option for first parameter type so it doesn't crash :)

Fixes issue In v5 of the migration-cli, where you get a PHP Fatal error when running migrate down without specifying a version number.
byjg added a commit to byjg/php-migration-cli that referenced this pull request Nov 20, 2024
@byjg byjg merged commit c8da6d3 into byjg:master Nov 21, 2024
4 checks passed
@byjg
Copy link
Owner

byjg commented Nov 21, 2024

Thank you. PR merged, and new release created 5.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants