-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Migration in a Postgresql database does not migrate in the specific schema. #11
Comments
Hey @jun1111 , unfortunately we can't help you if you don't provide us all informations necessary to reproduce your case. This means, always post:
As soon as you provide us all information needed, we have an easy way to reproduce your problem and provide you with the help or bugfix you need. Thank you. |
node version: v4.4.5 database.json file content: output for command "db-migrate up": |
What is the following line in the database.json file for? I copied it from the documentation and left it unchanged. "filename": "~/dev.db" |
@jun1111 This is no where documented in relation with |
You also forgot to post the full verbose run, but it hardly seems that you misconfigured db-migrate though. Which command do you used? Really only db-migrate up? If yes, it is going to execute the config of the |
Please carefully read https://docs-0-10.dbmigrate.wizardtales.com/Getting%20Started/configuration again to understand how the config is structured. It allows you to define multiple environments though, you seem to confuse this with db configurations instead, which wont work if not using the right environment. |
@wzrdtales Thanks for your reply. Having read the documentation again, I have realized that "pg" is a environment. So I have removed the "dev" section from the database.json file and just kept the "pg" section. I now run it like the following and it works. It created the two tables in the correct schema. db-migrate up -e pg |
@jun1111 You can also define a different default via Basically the environment named |
@wzrdtales |
Well either you look at scopes with subconfigs or you just define multiple environments for it and execute them one by one. As this sounds as if you intend to do here something programatically you may want to use the module programatically instead. |
@wzrdtales Yes. I need to do it pragmatically. Thanks for your help. |
@wzrdtales Could you explain to me the following line in the created js file. How is it used and should I change it to a sensible value? Thanks. exports._meta = {
"version": 1
}; |
It defines the protocol version of your migration, and is intended for the transition helper introduced to ease the handling of some breaking changes that have been introduced. In short, don't touch it, just keep it as it is. |
I have followed the instruction in the documentation, created two files that will create a pets table and a owners table. I specified a schema name in the database.json file. However when the migration finishes, I found out that the new tables created are in the public schema!
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: