-
Notifications
You must be signed in to change notification settings - Fork 24
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
Specify database name #9
Comments
You can specify the database name in the connection string. Additionally, you can use an IoC container to build the the DocumentStore and pass it in to a Migration.
We still leverage the majority of the faculties provided by RavenDB :) |
Hmm - we choose our database when opening a session a little more On 4 February 2014 12:48, Khalid Abuhakmeh [email protected] wrote:
|
Could you explain what your application setup is? Why does your one application have multiple databases that would rely on one migration set? Should you have two different migration sets? |
If I were you I would create your own resolver using an IoC container and then inject it to the migrations that need it. That way you don't have to modify the library. It would probably be the most flexible way of accomplishing your goal and keeping your code clean. |
There are multiple databases with different datasets, but we have only one Additionally, in order to deal with developing on feature branches with Another option would simply be to specify the DatabaseName on the Wouldn't you also run into this problem with a multi-tenant setup, anyway? On 4 February 2014 13:38, Khalid Abuhakmeh [email protected] wrote:
|
The migrations only expose a DocumentStore. We leave the opening of sessions to you in each migration. The reason for this is to let you use a session or drop into database commands if you need to.
So in theory if you wanted to code a dependency that gets injected into each migration you are more than free to do that. Take this code for example.
This would accomplish what you are looking to do. Alternatively you could just reference any code to select the session in the migration. Am I making sense? |
OK.. but what about in Alter.Collection? That just goes straight to Also, the Runner stores the migration docs in the default db. Wouldn't it On 4 February 2014 14:06, Khalid Abuhakmeh [email protected] wrote:
|
Yeah you're right about Alter and the Runner, also WaitForIndexing. Do you want to spike something that would work for you and would maintain the current behavior? I imagine that if a Migration could take in a DatabaseName then that would solve the majority of the issues. Where that database name comes from is what I'm still not sure of. |
OK will try and do it over the next few days. On 4 February 2014 14:26, Khalid Abuhakmeh [email protected] wrote:
|
Awesome, thanks for pointing it out and thanks for taking an interest. Let me know if you have any questions. |
Did this issue get resolved? |
We've made it all work fine for us without any changes. |
Ok, I'm closing this issue then. |
Hi Khalid,
Am I missing something here or is there no way of specifying the database name?
Thanks,
Gaz
The text was updated successfully, but these errors were encountered: