Finbuckle.MultiTenant icon indicating copy to clipboard operation
Finbuckle.MultiTenant copied to clipboard

Creating a tenant is not creating a database for it

Open hamedwiz opened this issue 2 years ago • 2 comments

I'm using separate multi-tenant databases, but when I create a multi tenant using IMultiTenant Store and using the TryAdd() method it creates the row in table Tenants but it doesn't create a database for the tenant itself although I'm adding a connection string when creating it.

hamedwiz avatar Feb 25 '23 10:02 hamedwiz

Hello, The library will not actually create databases for you -- TryAdd is to add a tenant to the existing tenant store database not the database itself. For now the responsibility of creating the databases is up the your application or external processes.

You can use {dbContext}.Database.EnsureCreated() in your code to programmatically create the database if needed.

AndrewTriesToCode avatar Mar 10 '23 07:03 AndrewTriesToCode