Skip to content

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

@christophe-fms

Description

@christophe-fms

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions