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

doctrine:migrations:migrate command errors when at latest version #1011

Closed
d42ohpaz opened this issue Jun 19, 2020 · 5 comments
Closed

doctrine:migrations:migrate command errors when at latest version #1011

d42ohpaz opened this issue Jun 19, 2020 · 5 comments

Comments

@d42ohpaz
Copy link

Bug Report

Q A
BC Break yes
Version 3.0.0

Summary

Since upgrading, running bin/console doctrine:migrations:migrate -n is being considered an error, and it is returning an error code of 1. This breaks command-line utilities that use the exit status to determine the success of migrations - e.g., CI/CD deployment pipelines.

Prior to upgrading (back in the 1.x branches), running the migration tool was considered idempotent and would not produce the error it does now.

Current behavior

When running bin/console doctrine:migrations:migrate -n, I get the following error, and an exist state of 1:

[ERROR] The version "latest" couldn't be reached, you are at version "MyApp\Migrations\Version20200616140944"

How to reproduce

Run bin/console doctrine:migrations:migrate -n when you are already up-to-date on migrations.

Expected behavior

Running bin/console doctrine:migrations:migrate -n should not be considered an error, and it should return with a 0 (zero) status code.

@d42ohpaz
Copy link
Author

I forgot the --allow-no-migration flag. Apologies.

@BonBonSlick
Copy link

[ERROR] The version "latest" couldn't be reached, you are at version "0"


{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-json": "*",
        "cron/cron-bundle": "^2.4",
        "drenso/phan-extensions": "^2.5",
        "friendsofsymfony/rest-bundle": "^2.7",
        "nelmio/api-doc-bundle": "^3.5",
        "nelmio/cors-bundle": "^2.0",
        "phan/phan": "^2.5",
        "ramsey/uuid": "^3.9",
        "sensio/framework-extra-bundle": "^5.5",
        "symfony/browser-kit": "4.4.*",
        "symfony/console": "4.4.*",
        "symfony/dotenv": "4.4.*",
        "symfony/flex": "^1.3.1",
        "symfony/framework-bundle": "4.4.*",
        "symfony/http-client": "4.4.*",
        "symfony/lock": "4.4.*",
        "symfony/monolog-bundle": "^3.5",
        "symfony/options-resolver": "4.4.*",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "4.4.*",
        "symfony/serializer": "4.4.*",
        "symfony/serializer-pack": "^1.0",
        "symfony/validator": "4.4.*",
        "symfony/yaml": "4.4.*"
    },
    "require-dev": {
        "dama/doctrine-test-bundle": "^6.3",
        "doctrine/doctrine-fixtures-bundle": "^3.3",
        "phpdocumentor/reflection-docblock": "^4.0",
        "phpunit/phpunit": "^8.5",
        "roave/security-advisories": "dev-master",
        "symfony/maker-bundle": "^1.14",
        "symfony/phpunit-bridge": "^5.0"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.4.*"
        }
    }
}

@BonBonSlick
Copy link

doctrine_migrations:
    migrations_paths:
        dir_name: '%kernel.project_dir%/src/Migrations' // BAD
        'DoctrineMigrations': '%kernel.project_dir%/migrations' // BAD
        'DoctrineMigrations': '%kernel.project_dir%/src/Migrations' // GOOD!

What changed? Some package somewhere was updated. This BC occurred.

@goetas
Copy link
Member

goetas commented Jun 20, 2020

@9ae8sdf76 See #1015, that should make this behavior compatible with the previous 2.x version

@goetas
Copy link
Member

goetas commented Jun 20, 2020

@BonBonSlick please avoid posting questions not related to this ticket. If you have questions please open a dedicated ticket.

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

No branches or pull requests

3 participants