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

Changed migrations table name and now it tries to create it every time #80

Open
knifesk opened this issue Oct 31, 2018 · 2 comments
Open

Comments

@knifesk
Copy link

knifesk commented Oct 31, 2018

Hi, I'm using the lumen migrations for the failed_jobs table... So, I changed the name for the table to "migrations_doctrine" in the config file.. But now each time I try to add a new migration I get errors about:

An exception occurred while executing 'CREATE TABLE migrations_doctrine (version VARCHAR(255) NOT NULL, PRIMARY KEY(version)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB': 
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'migrations_doctrine' already exists      

Should I blacklist migrations_doctrine too?

@patrickbrouwers
Copy link
Contributor

Try blacklisting it here: https://github.com/laravel-doctrine/migrations/blob/1.2/config/migrations.php#L59 (even though it should just work out of the box)

@knifesk
Copy link
Author

knifesk commented Oct 31, 2018

I did.. but it didn't work. Apparently the setting is being used for creation, but when the doctrine/migrations library checks if the table exists it fails (because it wouldn't be trying to create it if it were using the "migrations" name), but when it tries to create it uses the correct name (which does exists) and then fails.. I ended up reverting to "migrations" and renamed the lumen's one to "migrations_lumen".. and voila.. everything works as expected...

I think there's a bug on the "check if migrations table_name exists". But I have no time to debug it as the project is demanding me a lot of my attention.. But at least I got it working and maybe someone with better knowledge about the internals of the library can check if that's actually the problem

Thanks @patrickbrouwers for your reply!

FTR: I did copy the ./vendor/..../config/migrations.php default config file to ./config/migrations.php

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