Add a SharedTableConvention to set IndexesUniqueAcrossTables = false

pull/257/head
Christopher Jolly 1 year ago
parent 7f92dfc329
commit 08be903455

@ -36,6 +36,8 @@ namespace Microsoft.EntityFrameworkCore.Metadata.Conventions
new JetStoreGenerationConvention(Dependencies, RelationalDependencies));
conventionSet.Replace<ValueGenerationConvention>(
new JetValueGenerationConvention(Dependencies, RelationalDependencies));
conventionSet.Replace<SharedTableConvention>(
new JetSharedTableConvention(Dependencies, RelationalDependencies));
return conventionSet;
}

@ -0,0 +1,30 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
// ReSharper disable once CheckNamespace
namespace Microsoft.EntityFrameworkCore.Metadata.Conventions;
/// <summary>
/// A convention that manipulates names of database objects for entity types that share a table to avoid clashes.
/// </summary>
public class JetSharedTableConvention : SharedTableConvention
{
/// <summary>
/// Creates a new instance of <see cref="JetSharedTableConvention" />.
/// </summary>
/// <param name="dependencies">Parameter object containing dependencies for this convention.</param>
/// <param name="relationalDependencies"> Parameter object containing relational dependencies for this convention.</param>
public JetSharedTableConvention(
ProviderConventionSetBuilderDependencies dependencies,
RelationalConventionSetBuilderDependencies relationalDependencies)
: base(dependencies, relationalDependencies)
{
}
/// <inheritdoc />
protected override bool IndexesUniqueAcrossTables
=> false;
}
Loading…
Cancel
Save