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

Where is the interaction point between OnModelCreating and the migrations? #1203

Closed
weitzhandler opened this issue Dec 27, 2018 — with docs.microsoft.com · 2 comments

Comments

Copy link
Contributor

weitzhandler commented Dec 27, 2018

I need to add custom SQL when migrating the database, but I don't want to mess with the migrations generated code, I rather doing it using the ModelBuilder in the OnModelCreating routine.

How can I interact between the ModelBuilder and the MigrationBuilder?

Related


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@weitzhandler
Copy link
Contributor Author

I've tried overriding SqlServerMigrationsSqlGenerator.Generate but I can't find my custom annotations in the provided parameters.

@weitzhandler
Copy link
Contributor Author

See solution here.

Please document this scenario @bricelam.

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

1 participant