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

fix: migrate:rollback -b negative number #7350

Merged
merged 2 commits into from
Mar 18, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Mar 12, 2023

Description
See #7349

Fixes the incorrect documentation and help.
We cannot specify negative number as an option value on CLI.

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

We cannot specify negative number as an option value on CLI.
@kenjis kenjis changed the title fix: migrate:rollback negative number fix: migrate:rollback -b negative number Mar 12, 2023
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this was a feature we lost, or if it never worked?

@kenjis kenjis merged commit 897980b into codeigniter4:develop Mar 18, 2023
@kenjis kenjis deleted the fix-migrate-rollback-relative branch March 18, 2023 00:36
@kenjis
Copy link
Member Author

kenjis commented Mar 18, 2023

It never worked. Arguments with leading - are options.

Checked 4.0.0:

--- a/system/Commands/Database/MigrateRollback.php
+++ b/system/Commands/Database/MigrateRollback.php
@@ -107,6 +107,7 @@ class MigrateRollback extends BaseCommand
     */
    public function run(array $params = [])
    {
+       dd(CLI::getOptions());
        $runner = Services::migrations();
 
        $group = $params['-g'] ?? CLI::getOption('g');
$ php spark migrate:rollback -b -10


CodeIgniter CLI Tool - Version 4.0.0 - Server-Time: 2023-03-17 19:45:57pm


┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CLI::getOptions()                                                                                                  │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
array (2) [
    'b' => null
    10 => null
]
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
Called from .../system/Commands/Database/MigrateRollback.php:110 [dd()]

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Mar 25, 2023
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 this pull request may close these issues.

3 participants