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

Bug: migrate:rollback -b impossible due to TypeError #8955

Closed
christophe-fms opened this issue Jun 11, 2024 · 4 comments · Fixed by #8958
Closed

Bug: migrate:rollback -b impossible due to TypeError #8955

christophe-fms opened this issue Jun 11, 2024 · 4 comments · Fixed by #8958
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@christophe-fms
Copy link

christophe-fms commented Jun 11, 2024

PHP Version

8.2

CodeIgniter4 Version

4.5.1

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.10.2

What happened?

I got this error when trying to rollback :

Argument #1 ($targetBatch) must be of type int, string given, called in C:\[...]\system\Commands\Database\MigrateRollback.php on line 87 at SYSTEMPATH\Database\MigrationRunner.php:226
Backtrace:
  1    SYSTEMPATH\Commands\Database\MigrateRollback.php:87
       CodeIgniter\Database\MigrationRunner()->regress('52')

Steps to Reproduce

Run this command : php spark migrate:rollback -b 52 (my batch number)

Expected Output

The rollback should have been done with a success message, or an error if function down is not correct

Anything else?

The batch number is considered as a string ('52'), i think the correct call would be CodeIgniter\Database\MigrationRunner()->regress(52)

@christophe-fms christophe-fms added the bug Verified issues on the current code behavior or pull requests that will fix them label Jun 11, 2024
@neznaika0
Copy link
Contributor

There don't seem to be any tests. This is most likely due to strict_types=1

@kenjis kenjis changed the title Bug: migration:rollback impossible due to argument 1 type Bug: "migration:rollback -b" impossible due to argument 1 type Jun 12, 2024
@kenjis kenjis changed the title Bug: "migration:rollback -b" impossible due to argument 1 type Bug: "migration:rollback -b" impossible due to TypeError Jun 12, 2024
@kenjis kenjis changed the title Bug: "migration:rollback -b" impossible due to TypeError Bug: "migrate:rollback -b" impossible due to TypeError Jun 12, 2024
@kenjis
Copy link
Member

kenjis commented Jun 12, 2024

Chekc #8958

@kenjis kenjis changed the title Bug: "migrate:rollback -b" impossible due to TypeError Bug: migrate:rollback -b impossible due to TypeError Jun 12, 2024
@christophe-fms
Copy link
Author

Thanks, it works fine now :-D

@kenjis
Copy link
Member

kenjis commented Jun 13, 2024

The PR is not merged yet.
You don't need to close this issue, because it will be closed automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants