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 up and down differ in case for a table name #197

Closed
khasinski opened this issue Jan 5, 2015 · 2 comments
Closed

Migrations up and down differ in case for a table name #197

khasinski opened this issue Jan 5, 2015 · 2 comments

Comments

@khasinski
Copy link

I've changed one field in my model from not null to default null, generated a migration using diff and got:

class Version20150105175136 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('ALTER TABLE badge ALTER company_id DROP NOT NULL');
    }

    public function down(Schema $schema)
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('ALTER TABLE Badge ALTER company_id SET NOT NULL');
    }
}

Please note the name Badge and badge in up and down migrations. Is this a bug?

@stof
Copy link
Member

stof commented Jan 5, 2015

This should be reported in the issue tracker of the DBAL project, because the Migrations project is not responsible for computing the schema changes.

@stof stof closed this as completed Jan 5, 2015
@khasinski
Copy link
Author

I've put it on their bugtracker, it's available here: http://www.doctrine-project.org/jira/browse/DBAL-1107

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