-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSqlTableDifferences.cs
More file actions
83 lines (72 loc) · 3.54 KB
/
SqlTableDifferences.cs
File metadata and controls
83 lines (72 loc) · 3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//-----------------------------------------------------------------------
// <copyright file="SqlTableDifferences.cs" company="P.O.S Informatique">
// Copyright (c) P.O.S Informatique. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace PosInformatique.Testing.Databases
{
using System.Collections.ObjectModel;
/// <summary>
/// Represents the differences of a <see cref="SqlTable"/> between two databases.
/// </summary>
public sealed class SqlTableDifferences : SqlObjectDifferences<SqlTable>
{
internal SqlTableDifferences(
SqlTable? source,
SqlTable? target,
SqlObjectDifferenceType type,
IReadOnlyList<SqlObjectPropertyDifference>? properties,
IList<SqlColumnDifferences> columns,
IList<SqlObjectDifferences<SqlTrigger>> triggers,
IList<SqlObjectDifferences<SqlCheckConstraint>> checkConstraints,
IList<SqlIndexDifferences> indexes,
IList<SqlForeignKeyDifferences> foreignKeys,
IList<SqlUniqueConstraintDifferences> uniqueConstraints)
: base(source, target, type, properties)
{
this.Columns = new ReadOnlyCollection<SqlColumnDifferences>(columns);
this.Triggers = new ReadOnlyCollection<SqlObjectDifferences<SqlTrigger>>(triggers);
this.CheckConstraints = new ReadOnlyCollection<SqlObjectDifferences<SqlCheckConstraint>>(checkConstraints);
this.Indexes = new ReadOnlyCollection<SqlIndexDifferences>(indexes);
this.ForeignKeys = new ReadOnlyCollection<SqlForeignKeyDifferences>(foreignKeys);
this.UniqueConstraints = new ReadOnlyCollection<SqlUniqueConstraintDifferences>(uniqueConstraints);
}
internal SqlTableDifferences(
SqlObjectDifferences<SqlTable> differences)
: this(differences.Source, differences.Target, differences.Type, differences.Properties, [], [], [], [], [], [])
{
}
/// <summary>
/// Gets the check constraint differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlObjectDifferences<SqlCheckConstraint>> CheckConstraints { get; }
/// <summary>
/// Gets the columns differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlColumnDifferences> Columns { get; }
/// <summary>
/// Gets the indexes differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlIndexDifferences> Indexes { get; }
/// <summary>
/// Gets the primary key differences between the two SQL tables.
/// </summary>
public SqlPrimaryKeyDifferences? PrimaryKey { get; internal set; }
/// <summary>
/// Gets the foreign keys differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlForeignKeyDifferences> ForeignKeys { get; }
/// <summary>
/// Gets the triggers differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlObjectDifferences<SqlTrigger>> Triggers { get; }
/// <summary>
/// Gets the unique constraints differences between the two SQL tables.
/// </summary>
public ReadOnlyCollection<SqlUniqueConstraintDifferences> UniqueConstraints { get; }
internal override void Accept(ISqlObjectDifferencesVisitor visitor)
{
visitor.Visit(this);
}
}
}