You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL Server database table creation issue for the following foreign keys :-
Table - [webhook_delivery_results]
Cannot create the foreign key "FK_webhook_delivery_results_event_info_event_id" with the SET NULL referential action, because one or more referencing columns are not nullable.
Cannot create the foreign key "FK_webhook_delivery_results_webhook_receivers_receiver_id" with the SET NULL referential action, because one or more referencing columns are not nullable.
Cannot create the foreign key "FK_webhook_delivery_results_webhooks_WebhookId" with the SET NULL referential action, because one or more referencing columns are not nullable.
Code example:
builder.Services.AddWebhookSubscriptions<DbWebhookSubscription>()
.UseEntityFramework(ef =>
ef.UseContext(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString(nameof(WebhookDbContext)))));
using (var scope = app.Services.CreateScope())
{
var dataContext = scope.ServiceProvider.GetRequiredService<WebhookDbContext>();
dataContext.Database.EnsureCreated();
}
The foreign key constraints possible requires to be delete on cascade?
The text was updated successfully, but these errors were encountered:
Thank you @qsngoon for the notification of this bug. In fact, as you can see from the code, I have used only SQLite to test the Entity Framework data layer, and this aspect didn't emerge before.
I have created a test suite to use MS SQL Server as one of the reference databases for the Entity Framework data layer, and I was able to reproduce the issue, quickly fixing it.
SQL Server database table creation issue for the following foreign keys :-
Table - [webhook_delivery_results]
Cannot create the foreign key "FK_webhook_delivery_results_event_info_event_id" with the SET NULL referential action, because one or more referencing columns are not nullable.
Cannot create the foreign key "FK_webhook_delivery_results_webhook_receivers_receiver_id" with the SET NULL referential action, because one or more referencing columns are not nullable.
Cannot create the foreign key "FK_webhook_delivery_results_webhooks_WebhookId" with the SET NULL referential action, because one or more referencing columns are not nullable.
Code example:
The foreign key constraints possible requires to be delete on cascade?
The text was updated successfully, but these errors were encountered: