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

bake migration_snapshot not working with --connection option anymore? #88

Closed
kevinquinnyo opened this issue May 28, 2015 · 2 comments · Fixed by #89
Closed

bake migration_snapshot not working with --connection option anymore? #88

kevinquinnyo opened this issue May 28, 2015 · 2 comments · Fixed by #89
Labels
Milestone

Comments

@kevinquinnyo
Copy link

I built out migration snapshots for all of our plugins for an application were building a few weeks ago no problem. Recently we refactored one of them so much that I'm trying to build a new initial migration for it based on a snapshot.

The following command is no longer working. Example uses a plugin called 'Inventory' with connection 'inventory':

# running this from parent application
bin/cake bake migration_snapshot TestingMigration -p Inventory -c inventory

I get the following:

  [InvalidArgumentException]                                                                            
  There was a problem connecting to the database: SQLSTATE[28000] [1045] Access denied for user 'my_ap  
  p'@'localhost' (using password: YES)     

So it's attempting to use the default connection. The connection I'm trying to use does however exist, so it shouldn't be falling back.

I also noticed that it is able to connect, by enabling the mysql general_log I can see:

150528 14:26:24 526861 Connect  root@localhost on inventory
526861 Query    SET time_zone = '+0:00'
526861 Query    SET NAMES utf8
526861 Query    SHOW TABLES FROM `inventory`
526862 Connect  my_app@localhost on my_app
526862 Connect  Access denied for user 'my_app'@'localhost' (using password: YES)
526861 Quit 

So it seems that it's able to use the specified connection to run SHOW TABLES, but then it immediately goes back to the default connection after that and fails.

Am I doing something wrong here or has a bug been introduced recently?

@markstory markstory added the bug label May 28, 2015
@markstory markstory added this to the 1.1.1 milestone May 28, 2015
@HavokInspiration
Copy link
Member

I checked it out and it seems to be something I introduced when implementing the mark_migrated feature (meaning that baked snapshot will be automatically mark as migrated).
I'll try to fix this.

@HavokInspiration
Copy link
Member

Pull request #89 opened.
Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants