-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
"Scaffold" triggers for SQL Server #28253
Conversation
var table = tables.Single(t => t.Schema == tableSchema && t.Name == tableName); | ||
|
||
var triggers = new HashSet<string>(); | ||
table[RelationalAnnotationNames.Triggers] = triggers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the annotation value here is HashSet<string>
, which is different from what we do via the Fluent API (Dictionary<string, ITrigger>
), because ITrigger needs to reference an IMutableEntityType which we don't have here. The translation from this to that happens in RelationalScaffoldingModelFactory.
Scaffolding codegen needs to happen in CSharpDbContextGenerator and not in AnnotationCodeGenerator, since on the model snapshot side special code handles triggers in CSharpSnapshotGenerator. Should have done this after @bricelam's template work :( |
LGTM - makes using previews a better experience. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Ready for review, unrelated Cosmos test failures due to flakiness (:angry:) |
Why are the Cosmos tests running on that build? Did we enable Cosmos there at some point and I forgot about it? @smitpatel? |
Also, it's interesting that it's new tests ( |
Agree that it's strange! Though also not supposed to be related to this PR in any way... |
Use efcore/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindFunctionsQueryCosmosTest.cs Lines 1316 to 1324 in bda79d4
|
@smitpatel did that locally as part of #28139, PR out soon. |
HasTrigger with trigger name only, to make the SQL Server SaveChanges work out of the box. Closes dotnet#28185
HasTrigger with trigger name only, to make the SQL Server SaveChanges work out of the box.
Closes #28185