-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Creating Multiple Databases without init script #338
Comments
Heh, this is a cute hack -- I'm not sure what to do with it either. Either leave it as an easter egg or try to do some form of I'm inclined to simply leave it as an undocumented thing that happens to work as a consequence of how our script works and leave it alone (since we'd likely have to add more dependencies and thus make the image bigger to attempt to "fix" it properly and having backtick in a database name should be pretty rare and those folks should have to think long and hard about what the heck they're doing). |
Since this isn't something we've deemed worth fixing, I'm going to close -- the issue will hopefully serve as a good enough reference for folks looking to take advantage of this accidental "feature" (which is really a bug, to be explicitly clear). 👍 |
Awesome! |
This is cute, but surely there's a cleaner way to create multiple database on init? What about permission grants? |
The cleaner way is to use a proper SQL file (or shell script) in |
@tianon can I just have two .sql scripts, each with 'create database' commands in them or is there something more necessary? |
That should be plenty, yep!
|
I found a bug/feature. I was able to create multiple databases without the need for my own dockerfile. I kinda abused the docker-entrypoint.sh. Below is a terminal session that shows how I did it
I'm not sure want to do with this information, but it works as a quick hack to get multiple databases.
The text was updated successfully, but these errors were encountered: