-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TableIndex and UniqueConstraint to the relational model.
Part of #12846
- Loading branch information
1 parent
9655da8
commit 6d9ea74
Showing
26 changed files
with
932 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents a table index. | ||
/// </summary> | ||
public interface ITableIndex : IAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the name of the index. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets the mapped indexes. | ||
/// </summary> | ||
IEnumerable<IIndex> MappedIndexes { get; } | ||
|
||
/// <summary> | ||
/// Gets the table on with the index is declared. | ||
/// </summary> | ||
ITable Table { get; } | ||
|
||
/// <summary> | ||
/// Gets the columns that are participating in the index. | ||
/// </summary> | ||
IReadOnlyList<IColumn> Columns { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether the index enforces uniqueness. | ||
/// </summary> | ||
bool IsUnique { get; } | ||
|
||
/// <summary> | ||
/// Gets the expression used as the index filter. | ||
/// </summary> | ||
string Filter { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata | ||
{ | ||
/// <summary> | ||
/// Represents a unique constraint. | ||
/// </summary> | ||
public interface IUniqueConstraint : IAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the name of the unique constraint. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether this constraint is the primary key. | ||
/// </summary> | ||
bool IsPrimaryKey { get; } | ||
|
||
/// <summary> | ||
/// Gets the mapped keys. | ||
/// </summary> | ||
IEnumerable<IKey> MappedKeys { get; } | ||
|
||
/// <summary> | ||
/// Gets the table on with the unique constraint is declared. | ||
/// </summary> | ||
ITable Table { get; } | ||
|
||
/// <summary> | ||
/// Gets the columns that are participating in the unique constraint. | ||
/// </summary> | ||
IReadOnlyList<IColumn> Columns { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.