add foreign keys and constraints (#1316)

* add foreign keys and constraints

* add property name
This commit is contained in:
Alan Ren
2021-11-18 15:01:10 -08:00
committed by GitHub
parent c03557aae7
commit b131d1738d
13 changed files with 353 additions and 94 deletions

View File

@@ -0,0 +1,34 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Newtonsoft.Json;
namespace Microsoft.SqlTools.ServiceLayer.TableDesigner.Contracts
{
/// <summary>
/// The view model of foreign key.
/// </summary>
public class ForeignKeyViewModel : ObjectViewModelBase
{
public CheckBoxProperties Enabled { get; set; } = new CheckBoxProperties();
public DropdownProperties OnDeleteAction { get; set; } = new DropdownProperties();
public DropdownProperties OnUpdateAction { get; set; } = new DropdownProperties();
public DropdownProperties PrimaryKeyTable { get; set; } = new DropdownProperties();
public CheckBoxProperties IsNotForReplication { get; set; } = new CheckBoxProperties();
public TableComponentProperties<ForeignKeyColumnMapping> Columns { get; set; } = new TableComponentProperties<ForeignKeyColumnMapping>();
}
public class ForeignKeyColumnMapping
{
public DropdownProperties PrimaryKeyColumn { get; set; } = new DropdownProperties();
public DropdownProperties ForeignKeyColumn { get; set; } = new DropdownProperties();
}
}