fix Hosts
This commit is contained in:
1445
PARR.DAL/Migrations/20230919234848_TblHostsFixRElToTemplate.Designer.cs
generated
Normal file
1445
PARR.DAL/Migrations/20230919234848_TblHostsFixRElToTemplate.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace PARR.DAL.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class TblHostsFixRElToTemplate : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_Hosts_Hosts_HostId",
|
||||||
|
table: "Hosts");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_Hosts_HostId",
|
||||||
|
table: "Hosts");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "HostId",
|
||||||
|
table: "Hosts");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Guid>(
|
||||||
|
name: "HostId",
|
||||||
|
table: "Hosts",
|
||||||
|
type: "uuid",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_Hosts_HostId",
|
||||||
|
table: "Hosts",
|
||||||
|
column: "HostId");
|
||||||
|
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Hosts_Hosts_HostId",
|
||||||
|
table: "Hosts",
|
||||||
|
column: "HostId",
|
||||||
|
principalTable: "Hosts",
|
||||||
|
principalColumn: "Id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -518,9 +518,6 @@ namespace PARR.DAL.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<Guid?>("HostId")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<string>("IP")
|
b.Property<string>("IP")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@@ -536,8 +533,6 @@ namespace PARR.DAL.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("HostId");
|
|
||||||
|
|
||||||
b.ToTable("Hosts");
|
b.ToTable("Hosts");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1192,13 +1187,6 @@ namespace PARR.DAL.Migrations
|
|||||||
b.Navigation("Work");
|
b.Navigation("Work");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Host", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("PARR.DAL.Models.Host", null)
|
|
||||||
.WithMany("Hosts")
|
|
||||||
.HasForeignKey("HostId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Subprocess", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Subprocess", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("PARR.DAL.Models.Process", "Process")
|
b.HasOne("PARR.DAL.Models.Process", "Process")
|
||||||
@@ -1219,7 +1207,7 @@ namespace PARR.DAL.Migrations
|
|||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("PARR.DAL.Models.Host", "Host")
|
b.HasOne("PARR.DAL.Models.Host", "Host")
|
||||||
.WithMany()
|
.WithMany("Templates")
|
||||||
.HasForeignKey("HostId")
|
.HasForeignKey("HostId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@@ -1379,7 +1367,7 @@ namespace PARR.DAL.Migrations
|
|||||||
{
|
{
|
||||||
b.Navigation("ApplicationsInHosts");
|
b.Navigation("ApplicationsInHosts");
|
||||||
|
|
||||||
b.Navigation("Hosts");
|
b.Navigation("Templates");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("PARR.DAL.Models.Process", b =>
|
modelBuilder.Entity("PARR.DAL.Models.Process", b =>
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ namespace PARR.DAL.Models
|
|||||||
|
|
||||||
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
public ICollection<ApplicationInHost> ApplicationsInHosts { get; set; } = new HashSet<ApplicationInHost>();
|
||||||
|
|
||||||
public ICollection<Host> Hosts { get; set; } = new HashSet<Host>();
|
public ICollection<Template> Templates { get; set; } = new HashSet<Template>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user