Изменить миграцию по части DataSourceSystem

This commit is contained in:
Roman Efremov 2024-12-13 11:00:41 +05:00
parent ba75f2c888
commit 8f76400d77
2 changed files with 14 additions and 14 deletions

View File

@ -11,16 +11,16 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DrillingSystem",
name: "DataSourceSystem",
columns: table => new
{
SystemId = table.Column<Guid>(type: "uuid", nullable: false, comment: "Id системы автобурения"),
Name = table.Column<string>(type: "varchar(256)", nullable: false, comment: "Наименование системы автобурения"),
Description = table.Column<string>(type: "text", nullable: true, comment: "Описание системы автобурения")
SystemId = table.Column<Guid>(type: "uuid", nullable: false, comment: "Id системы - источника данных"),
Name = table.Column<string>(type: "varchar(256)", nullable: false, comment: "Наименование системы - источника данных"),
Description = table.Column<string>(type: "text", nullable: true, comment: "Описание системы - источника данных")
},
constraints: table =>
{
table.PrimaryKey("PK_DrillingSystem", x => x.SystemId);
table.PrimaryKey("PK_DataSourceSystem", x => x.SystemId);
});
migrationBuilder.CreateTable(
@ -38,9 +38,9 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
{
table.PrimaryKey("PK_TechMessage", x => x.EventId);
table.ForeignKey(
name: "FK_TechMessage_DrillingSystem_SystemId",
name: "FK_TechMessage_DataSourceSystem_SystemId",
column: x => x.SystemId,
principalTable: "DrillingSystem",
principalTable: "DataSourceSystem",
principalColumn: "SystemId",
onDelete: ReferentialAction.Cascade);
});
@ -58,7 +58,7 @@ namespace Persistence.Database.Postgres.Migrations.PersistencePostgres
name: "TechMessage");
migrationBuilder.DropTable(
name: "DrillingSystem");
name: "DataSourceSystem");
}
}
}

View File

@ -24,25 +24,25 @@ namespace Persistence.Database.Postgres.Migrations
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "adminpack");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Persistence.Database.Entity.DrillingSystem", b =>
modelBuilder.Entity("Persistence.Database.Entity.DataSourceSystem", b =>
{
b.Property<Guid>("SystemId")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasComment("Id системы автобурения");
.HasComment("Id системы - источника данных");
b.Property<string>("Description")
.HasColumnType("text")
.HasComment("Описание системы автобурения");
.HasComment("Описание системы - источника данных");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(256)")
.HasComment("Наименование системы автобурения");
.HasComment("Наименование системы - источника данных");
b.HasKey("SystemId");
b.ToTable("DrillingSystem");
b.ToTable("DataSourceSystem");
});
modelBuilder.Entity("Persistence.Database.Entity.ParameterData", b =>
@ -289,7 +289,7 @@ namespace Persistence.Database.Postgres.Migrations
modelBuilder.Entity("Persistence.Database.Entity.TechMessage", b =>
{
b.HasOne("Persistence.Database.Entity.DrillingSystem", "System")
b.HasOne("Persistence.Database.Entity.DataSourceSystem", "System")
.WithMany()
.HasForeignKey("SystemId")
.OnDelete(DeleteBehavior.Cascade)