Changing table schema
RemiBou opened this issue · 9 comments
Hi, given the generic names (ExportHistory,ImportHistory) it would be nice to be able to change the schema containing the tables.
I don't know how I should do this, with a short explanation i can send PR.
You could do this in the context
https://github.com/damienbod/AspNet5Localization/blob/master/AspNet5Localization/src/Localization.SqlLocalizer/DbStringLocalizer/LocalizationModelContext.cs
cheers Damien
@RemiBou We could create another constructor on the LocalizationModelContext which takes an new interface or class as a param, which would be used instead of the default class registered in the extensions class... This can be used to set the schema stuff on the LocalizationModelContext. This would then need to be set in the IoC in the right order. Not sure if this is good.
Or we could just create a static property on the LocalizationModelContext class.
We might create an Option class so the user can change the table names or even add a a callback to this options expecting the modelbuilder in the parameters so everyone can add what they want.
Because you're the original developper of this project do you have any prefered solution ?
I'll try to send the PR next week.
Thanks, I'll create the package and the docs today
Do you have a twitter handle and I'll give you a shout out
Thanks for the changes
Greetings Damien
@RemiBou I have problems using the new schema changes, the demo apps don't work due to IoC problems. I moved your changes to the devSchema branch, and will try to debug.
https://github.com/damienbod/AspNet5Localization/tree/devSchema
@RemiBou done
https://www.nuget.org/packages/Localization.SqlLocalizer/1.0.7
services.AddLocalizationSqlSchema("translations");
services.AddDbContext<LocalizationModelContext>(options =>
options.UseSqlite(
sqlConnectionString,
b => b.MigrationsAssembly("AspNet5Localization")
)
);