Skip to content
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

Changing table schema #26

Closed
RemiBou opened this issue Jan 20, 2017 · 9 comments
Closed

Changing table schema #26

RemiBou opened this issue Jan 20, 2017 · 9 comments

Comments

@RemiBou
Copy link
Contributor

RemiBou commented Jan 20, 2017

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.

@damienbod
Copy link
Owner

@RemiBou
Copy link
Contributor Author

RemiBou commented Jan 21, 2017 via email

@damienbod
Copy link
Owner

@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.

@RemiBou
Copy link
Contributor Author

RemiBou commented Jan 21, 2017

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.

@damienbod
Copy link
Owner

@RemiBou thanks

@damienbod
Copy link
Owner

#27

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

@damienbod damienbod reopened this Jan 27, 2017
@damienbod
Copy link
Owner

@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

@damienbod
Copy link
Owner

@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")
  )
);

@RemiBou
Copy link
Contributor Author

RemiBou commented Feb 6, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants