Add new migration
This commit is contained in:
300
Hcs.WebApp/Data/Hcs/Migrations/20251117080414_UpdateFileToParseEntity.Designer.cs
generated
Normal file
300
Hcs.WebApp/Data/Hcs/Migrations/20251117080414_UpdateFileToParseEntity.Designer.cs
generated
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
namespace Hcs.WebApp.Data.Hcs.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(HcsDbContext))]
|
||||||
|
[Migration("20251117080414_UpdateFileToParseEntity")]
|
||||||
|
public partial class UpdateFileToParseEntity
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.9")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Campaign", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EndedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("FailureReason")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("InitiatorId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Progress")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("Step")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.ToTable("Campaigns");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.FileToParse", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("FileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int?>("LastParseOperationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("ParsedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Path")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("UploadedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UploaderId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("LastParseOperationId");
|
||||||
|
|
||||||
|
b.ToTable("FilesToParse");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.House", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<Guid?>("FiasId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<Guid?>("HcsId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<bool>("IsMkd")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<bool>("IsZhd")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<int?>("LastSyncOperationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("SyncedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("ThirdPartyId")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("FiasId")
|
||||||
|
.IsUnique()
|
||||||
|
.HasFilter("[FiasId] IS NOT NULL");
|
||||||
|
|
||||||
|
b.HasIndex("LastSyncOperationId");
|
||||||
|
|
||||||
|
b.ToTable("Houses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Operation", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<int>("CampaignId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("EndedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("FailureReason")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("MessageGuid")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("StartedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<string>("Type")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CampaignId");
|
||||||
|
|
||||||
|
b.ToTable("Operations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<bool>("IsCommon")
|
||||||
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<int?>("LastSyncOperationId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<int>("Number")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("SyncedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("LastSyncOperationId");
|
||||||
|
|
||||||
|
b.ToTable("Registries");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.Property<string>("Code")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("GUID")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<string>("Json")
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<Guid>("RegistryId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RegistryId");
|
||||||
|
|
||||||
|
b.ToTable("Elements");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.FileToParse", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hcs.WebApp.Data.Hcs.Operation", "LastParseOperation")
|
||||||
|
.WithMany("FilesToParse")
|
||||||
|
.HasForeignKey("LastParseOperationId");
|
||||||
|
|
||||||
|
b.Navigation("LastParseOperation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.House", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hcs.WebApp.Data.Hcs.Operation", "LastSyncOperation")
|
||||||
|
.WithMany("Houses")
|
||||||
|
.HasForeignKey("LastSyncOperationId");
|
||||||
|
|
||||||
|
b.Navigation("LastSyncOperation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Operation", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hcs.WebApp.Data.Hcs.Campaign", "Campaign")
|
||||||
|
.WithMany("Operations")
|
||||||
|
.HasForeignKey("CampaignId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Campaign");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hcs.WebApp.Data.Hcs.Operation", "LastSyncOperation")
|
||||||
|
.WithMany("Registries")
|
||||||
|
.HasForeignKey("LastSyncOperationId");
|
||||||
|
|
||||||
|
b.Navigation("LastSyncOperation");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.RegistryElement", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hcs.WebApp.Data.Hcs.Registry", "Registry")
|
||||||
|
.WithMany("Elements")
|
||||||
|
.HasForeignKey("RegistryId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("Registry");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Campaign", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Operations");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Operation", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("FilesToParse");
|
||||||
|
|
||||||
|
b.Navigation("Houses");
|
||||||
|
|
||||||
|
b.Navigation("Registries");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hcs.WebApp.Data.Hcs.Registry", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Elements");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
namespace Hcs.WebApp.Data.Hcs.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class UpdateFileToParseEntity : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Path",
|
||||||
|
table: "FilesToParse",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "int");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "FileName",
|
||||||
|
table: "FilesToParse",
|
||||||
|
type: "nvarchar(max)",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: "");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<DateTime>(
|
||||||
|
name: "UploadedAt",
|
||||||
|
table: "FilesToParse",
|
||||||
|
type: "datetime2",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "UploaderId",
|
||||||
|
table: "FilesToParse",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "FileName",
|
||||||
|
table: "FilesToParse");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "UploadedAt",
|
||||||
|
table: "FilesToParse");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "UploaderId",
|
||||||
|
table: "FilesToParse");
|
||||||
|
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "Path",
|
||||||
|
table: "FilesToParse",
|
||||||
|
type: "int",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "nvarchar(max)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -64,13 +64,24 @@ namespace Hcs.WebApp.Data.Hcs.Migrations
|
|||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("FileName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<int?>("LastParseOperationId")
|
b.Property<int?>("LastParseOperationId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<DateTime?>("ParsedAt")
|
b.Property<DateTime?>("ParsedAt")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
b.Property<int>("Path")
|
b.Property<string>("Path")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("UploadedAt")
|
||||||
|
.HasColumnType("datetime2");
|
||||||
|
|
||||||
|
b.Property<int>("UploaderId")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|||||||
Reference in New Issue
Block a user