feat(db): EF migration AddTemplateFolders
This commit is contained in:
@@ -845,6 +845,9 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("nvarchar(2000)");
|
||||
|
||||
b.Property<int?>("FolderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
@@ -855,6 +858,8 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("FolderId");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
@@ -982,6 +987,34 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
b.ToTable("TemplateCompositions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ScadaLink.Commons.Entities.Templates.TemplateFolder", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<int?>("ParentFolderId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ParentFolderId", "Name")
|
||||
.IsUnique()
|
||||
.HasFilter("[ParentFolderId] IS NOT NULL");
|
||||
|
||||
b.ToTable("TemplateFolders");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ScadaLink.Commons.Entities.Templates.TemplateScript", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1152,6 +1185,11 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
|
||||
modelBuilder.Entity("ScadaLink.Commons.Entities.Templates.Template", b =>
|
||||
{
|
||||
b.HasOne("ScadaLink.Commons.Entities.Templates.TemplateFolder", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("FolderId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("ScadaLink.Commons.Entities.Templates.Template", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentTemplateId")
|
||||
@@ -1191,6 +1229,14 @@ namespace ScadaLink.ConfigurationDatabase.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ScadaLink.Commons.Entities.Templates.TemplateFolder", b =>
|
||||
{
|
||||
b.HasOne("ScadaLink.Commons.Entities.Templates.TemplateFolder", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentFolderId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ScadaLink.Commons.Entities.Templates.TemplateScript", b =>
|
||||
{
|
||||
b.HasOne("ScadaLink.Commons.Entities.Templates.Template", null)
|
||||
|
||||
Reference in New Issue
Block a user