-
Notifications
You must be signed in to change notification settings - Fork 547
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
Code first EF migrations #2743
Comments
Unfortunately, although multi-tenancy is a very common requirement for software applications, it is generally not a first-class scenario which Microsoft considers when developing its tooling or frameworks. In most cases it is possible to work around these limitations and create a multi-tenant solution, however it generally requires a fair amount of ingenuity (which is precisely why there is a need for value-added frameworks like Oqtane). In regards to Oqtane and Migrations, there are actually multiple challenges. The first is multi-tenancy and second is support for multiple types of databases (ie. SQL Server, SQLite, PostgreSQL, mySQL). I have yet to see a solution which is able to support auto generated migrations while at the same time supporting multi-tenancy and multiple types of databases. There is a fairly long thread which contains a lot of context of how Microsoft views the topic of automated migrations in .NET Core: dotnet/efcore#6214 . |
Thanks for the reply Shaun! Regards, |
@pepsinio One solution that others have used is to create a simple console project during development which is hardwired to your preferred database, and then use the standard CLI tool "dotnet ef migrate" to generate your migration code - and then manually migrate that code into your Oqtane module. It is still a manual process however it might reduce some of the manual effort. |
Thanks for the tip Shaun! |
Hi Shaun and community,
I have been playing around with Oqtane and overall am quite impressed and would like to do a lot more with it.
One thing which really bothers me and can't find a solution is how to enable EF code first migrations to be auto generated.
I plan to do lots of data modelling and doing it by hand doesn't really cut it.
I tried adding IDesignTimeDbContextFactory and other tricks, but because of the multitenancy can't really get it to work.
Is there an easy way to enable this? If it possible to use the 'default' database as baseline would do just fine.
Follow up question in case there isn't an option: Would you be open to accept PR enabling this?
Regards,
Peter
The text was updated successfully, but these errors were encountered: