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

migrations:diff always creates Version file #104

Closed
derlarsen opened this issue Dec 10, 2012 · 1 comment
Closed

migrations:diff always creates Version file #104

derlarsen opened this issue Dec 10, 2012 · 1 comment

Comments

@derlarsen
Copy link

Using the following command

./doctrine migrations:diff

does always create a version file even if there are no changes to be made to the current schema.

The content of this file is for example

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration,
    Doctrine\DBAL\Schema\Schema;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20121210110653 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

    }
}

In Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand there is always the 'abortIf()' line added to the Version-Code.

As we want to use Migrations in a semi automatic build process these 'empty' versions are really annoying.

(Kind of duplicates #41)

@stof
Copy link
Member

stof commented Aug 18, 2014

Fixed by #160

@stof stof closed this as completed Aug 18, 2014
sserbin pushed a commit to sserbin/migrations that referenced this issue Dec 27, 2022
…n-no-interaction

Fix migrate command in --no-interaction mode
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

2 participants