SHA256
- Added new class to unify and type the format of StayExportFile.ExportDetails field. Note: This database migration will set to null all StayExportFile.ExportDetails data. This is required to prevent exceptions due to new formatting.
281 lines
11 KiB
C#
281 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Somnia.GuestLog.Infrastructure;
|
|
|
|
#nullable disable
|
|
|
|
namespace Somnia.GuestLog.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(GuestLogContext))]
|
|
partial class GuestLogContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.12")
|
|
.HasAnnotation("Proxies:ChangeTracking", false)
|
|
.HasAnnotation("Proxies:CheckEquality", false)
|
|
.HasAnnotation("Proxies:LazyLoading", true)
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("GuestDocumentStayEntry", b =>
|
|
{
|
|
b.Property<long>("StayEntryId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("GuestDocumentsId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("GuestDocumentsVersion")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("StayEntryId", "GuestDocumentsId", "GuestDocumentsVersion");
|
|
|
|
b.HasIndex("GuestDocumentsId", "GuestDocumentsVersion");
|
|
|
|
b.ToTable("GuestDocumentStayEntry");
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.GuestDocument", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<int>("Version")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateOnly>("BirthDate")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<DateTime>("CreateTime")
|
|
.HasColumnType("timestamp(3) with time zone");
|
|
|
|
b.Property<string>("DocumentNum")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("DocumentType")
|
|
.IsRequired()
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<string>("EmailAddress")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("Gender")
|
|
.HasMaxLength(1)
|
|
.HasColumnType("character varying(1)");
|
|
|
|
b.Property<bool>("IsLastVersion")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateOnly?>("IssueDate")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Nationality")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("character varying(3)");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("SupportNum")
|
|
.HasMaxLength(10)
|
|
.HasColumnType("character varying(10)");
|
|
|
|
b.Property<string>("Surname")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Surname2")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<DateTime>("UpdateTime")
|
|
.HasColumnType("timestamp(3) with time zone");
|
|
|
|
b.ComplexProperty(typeof(Dictionary<string, object>), "AddressDetails", "Somnia.GuestLog.Models.Entities.GuestDocument.AddressDetails#GuestAddress", b1 =>
|
|
{
|
|
b1.Property<string>("Address")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressCity")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressCountry")
|
|
.IsRequired()
|
|
.HasMaxLength(3)
|
|
.HasColumnType("character varying(3)");
|
|
|
|
b1.Property<string>("AddressProvince")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("AddressState")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b1.Property<string>("ZipCode")
|
|
.HasMaxLength(12)
|
|
.HasColumnType("character varying(12)");
|
|
});
|
|
|
|
b.HasKey("Id", "Version");
|
|
|
|
b.ToTable("GuestDocument", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.StayEntry", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("CreateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("DateIn")
|
|
.HasColumnType("timestamp(0) with time zone");
|
|
|
|
b.Property<DateTime>("DateOut")
|
|
.HasColumnType("timestamp(0) with time zone");
|
|
|
|
b.Property<string>("PaymentMethod")
|
|
.IsRequired()
|
|
.HasMaxLength(5)
|
|
.HasColumnType("character varying(5)");
|
|
|
|
b.Property<int>("RoomCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("RoomNumber")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<int>("StayUploadStatus")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime?>("StayUploadStatusTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("UpdateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("StayEntry", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Somnia.GuestLog.Models.Entities.StayExportFile", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<int>("ExportFormat")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ExportResult")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("ExportTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("ExportedPath")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<int>("FileUploadStatus")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime?>("FileUploadStatusTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.ComplexProperty(typeof(Dictionary<string, object>), "ExportDetails", "Somnia.GuestLog.Models.Entities.StayExportFile.ExportDetails#StayExportDetails", b1 =>
|
|
{
|
|
b1.Property<int?>("ExportedStayCount");
|
|
|
|
b1.Property<int?>("StayErrorCount");
|
|
|
|
b1.ComplexCollection(typeof(List<Dictionary<string, object>>), "StayEntries", "Somnia.GuestLog.Models.Entities.StayExportFile.ExportDetails#StayExportDetails.StayEntries#StayExportDetailsStayEntry", b2 =>
|
|
{
|
|
b2.IsRequired();
|
|
|
|
b2.Property<string>("Details");
|
|
|
|
b2.Property<int>("ExportResult");
|
|
|
|
b2.Property<long>("StayEntryId");
|
|
});
|
|
|
|
b1
|
|
.ToJson("ExportDetails")
|
|
.HasColumnType("jsonb");
|
|
});
|
|
|
|
b.ComplexProperty(typeof(Dictionary<string, object>), "ExportParams", "Somnia.GuestLog.Models.Entities.StayExportFile.ExportParams#StayExportParams", b1 =>
|
|
{
|
|
b1.IsRequired();
|
|
|
|
b1.Property<DateTime?>("ExportPeriodEnd");
|
|
|
|
b1.Property<DateTime?>("ExportPeriodStart");
|
|
|
|
b1.Property<int>("ExportType");
|
|
|
|
b1
|
|
.ToJson("ExportParams")
|
|
.HasColumnType("jsonb");
|
|
});
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("StayExportFile", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GuestDocumentStayEntry", b =>
|
|
{
|
|
b.HasOne("Somnia.GuestLog.Models.Entities.StayEntry", null)
|
|
.WithMany()
|
|
.HasForeignKey("StayEntryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Somnia.GuestLog.Models.Entities.GuestDocument", null)
|
|
.WithMany()
|
|
.HasForeignKey("GuestDocumentsId", "GuestDocumentsVersion")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|