We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb0ca2a commit b0be36bCopy full SHA for b0be36b
SQLite.CodeFirst.Console/Entity/Player.cs
@@ -6,9 +6,14 @@ namespace SQLite.CodeFirst.Console.Entity
6
public class Player : Person
7
{
8
[Index] // Automatically named 'IX_TeamPlayer_Number'
9
- [Unique(OnConflictAction.Fail)]
+ [Index("IX_TeamPlayer_NumberPerTeam", Order = 1, IsUnique = true)]
10
public int Number { get; set; }
11
12
+ // The index attribute must be placed on the FK not on the navigation property (team).
13
+ [Index("IX_TeamPlayer_NumberPerTeam", Order = 2, IsUnique = true)]
14
+ public int TeamId { get; set; }
15
+
16
+ // Its not possible to set an index on this property. Use the FK property (teamId).
17
public virtual Team Team { get; set; }
18
}
19
0 commit comments