31 lines
757 B
C#
31 lines
757 B
C#
|
using ServerDatabase.Utils;
|
||
|
using ServerDatabase.Utils.Enums;
|
||
|
|
||
|
namespace ServerDatabase;
|
||
|
|
||
|
public class ForeignKey : IForeignKey
|
||
|
{
|
||
|
public ConstraintAction OnUpdate { get; init; } = ConstraintAction.None;
|
||
|
public ConstraintAction OnDelete { get; init; } = ConstraintAction.None;
|
||
|
public KeyMatchType MatchType { get; init; } = KeyMatchType.Simple;
|
||
|
|
||
|
public required ITable Table { get; init; }
|
||
|
public required ITableColumn Column { get; init; }
|
||
|
|
||
|
private bool d = false;
|
||
|
|
||
|
public bool Deferrable { get; init; } = false;
|
||
|
|
||
|
public bool Deferred
|
||
|
{
|
||
|
get
|
||
|
{
|
||
|
return d & Deferrable;
|
||
|
}
|
||
|
init
|
||
|
{
|
||
|
d = value;
|
||
|
}
|
||
|
}
|
||
|
public bool Validated { get; init; } = false;
|
||
|
}
|