Миграция
This commit is contained in:
		
							
								
								
									
										502
									
								
								SchengenVisaApi/Infrastructure/Migrations/20250305064153_Initial.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										502
									
								
								SchengenVisaApi/Infrastructure/Migrations/20250305064153_Initial.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,502 @@ | ||||
| // <auto-generated /> | ||||
| using System; | ||||
| using Infrastructure.Database; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||||
| using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace Infrastructure.Migrations | ||||
| { | ||||
|     [DbContext(typeof(DatabaseContext))] | ||||
|     [Migration("20250305064153_Initial")] | ||||
|     partial class Initial | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void BuildTargetModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
| #pragma warning disable 612, 618 | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "9.0.2") | ||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 63); | ||||
|  | ||||
|             NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.Applicant", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<DateTime>("BirthDate") | ||||
|                         .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                     b.Property<string>("Citizenship") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(30) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(30)"); | ||||
|  | ||||
|                     b.Property<string>("CitizenshipByBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(30) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(30)"); | ||||
|  | ||||
|                     b.Property<string>("CityOfBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<string>("CountryOfBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<int>("Gender") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<bool>("IsNonResident") | ||||
|                         .HasColumnType("boolean"); | ||||
|  | ||||
|                     b.Property<string>("JobTitle") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(50) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                     b.Property<int>("MaritalStatus") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<Guid>("PlaceOfWorkId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<Guid>("UserId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("PlaceOfWorkId"); | ||||
|  | ||||
|                     b.HasIndex("UserId") | ||||
|                         .IsUnique(); | ||||
|  | ||||
|                     b.ToTable("Applicant"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.PlaceOfWork", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("Name") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(200) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                     b.Property<string>("PhoneNum") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(13) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(13)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("PlaceOfWork"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.Users.User", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("Email") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(254) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(254)"); | ||||
|  | ||||
|                     b.Property<string>("Password") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(50) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                     b.Property<int>("Role") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("Email") | ||||
|                         .IsUnique(); | ||||
|  | ||||
|                     b.ToTable("User"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.VisaApplicationDomain.VisaApplication", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<Guid>("ApplicantId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("DestinationCountry") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<bool>("ForGroup") | ||||
|                         .HasColumnType("boolean"); | ||||
|  | ||||
|                     b.Property<DateTime>("RequestDate") | ||||
|                         .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                     b.Property<int>("RequestedNumberOfEntries") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("Status") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("ValidDaysRequested") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("VisaCategory") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("ApplicantId"); | ||||
|  | ||||
|                     b.ToTable("VisaApplication"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.Applicant", b => | ||||
|                 { | ||||
|                     b.HasOne("Domains.ApplicantDomain.PlaceOfWork", "PlaceOfWork") | ||||
|                         .WithMany() | ||||
|                         .HasForeignKey("PlaceOfWorkId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.HasOne("Domains.Users.User", null) | ||||
|                         .WithOne() | ||||
|                         .HasForeignKey("Domains.ApplicantDomain.Applicant", "UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "FatherName", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "MotherName", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "Name", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Passport", "Passport", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("IssueDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Issuer") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(200) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                             b1.Property<string>("Number") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(20) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(20)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("FatherName") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("MotherName") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("Name") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("Passport") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("PlaceOfWork"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.PlaceOfWork", b => | ||||
|                 { | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Address", "Address", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("PlaceOfWorkId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("Building") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(10) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(10)"); | ||||
|  | ||||
|                             b1.Property<string>("City") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<string>("Country") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<string>("Street") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(100) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(100)"); | ||||
|  | ||||
|                             b1.HasKey("PlaceOfWorkId"); | ||||
|  | ||||
|                             b1.ToTable("PlaceOfWork"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("PlaceOfWorkId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("Address") | ||||
|                         .IsRequired(); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.VisaApplicationDomain.VisaApplication", b => | ||||
|                 { | ||||
|                     b.HasOne("Domains.ApplicantDomain.Applicant", null) | ||||
|                         .WithMany() | ||||
|                         .HasForeignKey("ApplicantId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.OwnsMany("Domains.VisaApplicationDomain.PastVisa", "PastVisas", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<int>("Id") | ||||
|                                 .ValueGeneratedOnAdd() | ||||
|                                 .HasColumnType("integer"); | ||||
|  | ||||
|                             NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id")); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("IssueDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Name") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId", "Id"); | ||||
|  | ||||
|                             b1.ToTable("PastVisa"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsMany("Domains.VisaApplicationDomain.PastVisit", "PastVisits", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<int>("Id") | ||||
|                                 .ValueGeneratedOnAdd() | ||||
|                                 .HasColumnType("integer"); | ||||
|  | ||||
|                             NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id")); | ||||
|  | ||||
|                             b1.Property<string>("DestinationCountry") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<DateTime>("EndDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("StartDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId", "Id"); | ||||
|  | ||||
|                             b1.ToTable("PastVisit"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.VisaApplicationDomain.PermissionToDestCountry", "PermissionToDestCountry", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Issuer") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(200) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId"); | ||||
|  | ||||
|                             b1.ToTable("VisaApplication"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.VisaApplicationDomain.ReentryPermit", "ReentryPermit", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Number") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(25) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(25)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId"); | ||||
|  | ||||
|                             b1.ToTable("VisaApplication"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("PastVisas"); | ||||
|  | ||||
|                     b.Navigation("PastVisits"); | ||||
|  | ||||
|                     b.Navigation("PermissionToDestCountry"); | ||||
|  | ||||
|                     b.Navigation("ReentryPermit"); | ||||
|                 }); | ||||
| #pragma warning restore 612, 618 | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,211 @@ | ||||
| using System; | ||||
| using Microsoft.EntityFrameworkCore.Migrations; | ||||
| using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace Infrastructure.Migrations | ||||
| { | ||||
|     /// <inheritdoc /> | ||||
|     public partial class Initial : Migration | ||||
|     { | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Up(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "PlaceOfWork", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Name = table.Column<string>(type: "character varying(200)", unicode: false, maxLength: 200, nullable: false), | ||||
|                     Address_Country = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     Address_City = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     Address_Street = table.Column<string>(type: "character varying(100)", unicode: false, maxLength: 100, nullable: false), | ||||
|                     Address_Building = table.Column<string>(type: "character varying(10)", unicode: false, maxLength: 10, nullable: false), | ||||
|                     PhoneNum = table.Column<string>(type: "character varying(13)", unicode: false, maxLength: 13, nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_PlaceOfWork", x => x.Id); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "User", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Role = table.Column<int>(type: "integer", nullable: false), | ||||
|                     Email = table.Column<string>(type: "character varying(254)", unicode: false, maxLength: 254, nullable: false), | ||||
|                     Password = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_User", x => x.Id); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "Applicant", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     UserId = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Name_FirstName = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     Name_Surname = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     Name_Patronymic = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: true), | ||||
|                     Passport_Number = table.Column<string>(type: "character varying(20)", unicode: false, maxLength: 20, nullable: false), | ||||
|                     Passport_Issuer = table.Column<string>(type: "character varying(200)", unicode: false, maxLength: 200, nullable: false), | ||||
|                     Passport_IssueDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     Passport_ExpirationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     BirthDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     CountryOfBirth = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     CityOfBirth = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     Citizenship = table.Column<string>(type: "character varying(30)", unicode: false, maxLength: 30, nullable: false), | ||||
|                     CitizenshipByBirth = table.Column<string>(type: "character varying(30)", unicode: false, maxLength: 30, nullable: false), | ||||
|                     Gender = table.Column<int>(type: "integer", nullable: false), | ||||
|                     MaritalStatus = table.Column<int>(type: "integer", nullable: false), | ||||
|                     FatherName_FirstName = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     FatherName_Surname = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     FatherName_Patronymic = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: true), | ||||
|                     MotherName_FirstName = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     MotherName_Surname = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     MotherName_Patronymic = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: true), | ||||
|                     JobTitle = table.Column<string>(type: "character varying(50)", unicode: false, maxLength: 50, nullable: false), | ||||
|                     PlaceOfWorkId = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     IsNonResident = table.Column<bool>(type: "boolean", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_Applicant", x => x.Id); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_Applicant_PlaceOfWork_PlaceOfWorkId", | ||||
|                         column: x => x.PlaceOfWorkId, | ||||
|                         principalTable: "PlaceOfWork", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_Applicant_User_UserId", | ||||
|                         column: x => x.UserId, | ||||
|                         principalTable: "User", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "VisaApplication", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     Id = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     ApplicantId = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Status = table.Column<int>(type: "integer", nullable: false), | ||||
|                     ReentryPermit_Number = table.Column<string>(type: "character varying(25)", unicode: false, maxLength: 25, nullable: true), | ||||
|                     ReentryPermit_ExpirationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), | ||||
|                     DestinationCountry = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     PermissionToDestCountry_ExpirationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), | ||||
|                     PermissionToDestCountry_Issuer = table.Column<string>(type: "character varying(200)", unicode: false, maxLength: 200, nullable: true), | ||||
|                     VisaCategory = table.Column<int>(type: "integer", nullable: false), | ||||
|                     ForGroup = table.Column<bool>(type: "boolean", nullable: false), | ||||
|                     RequestedNumberOfEntries = table.Column<int>(type: "integer", nullable: false), | ||||
|                     RequestDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     ValidDaysRequested = table.Column<int>(type: "integer", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_VisaApplication", x => x.Id); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_VisaApplication_Applicant_ApplicantId", | ||||
|                         column: x => x.ApplicantId, | ||||
|                         principalTable: "Applicant", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "PastVisa", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     VisaApplicationId = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Id = table.Column<int>(type: "integer", nullable: false) | ||||
|                         .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), | ||||
|                     IssueDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     Name = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false), | ||||
|                     ExpirationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_PastVisa", x => new { x.VisaApplicationId, x.Id }); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_PastVisa_VisaApplication_VisaApplicationId", | ||||
|                         column: x => x.VisaApplicationId, | ||||
|                         principalTable: "VisaApplication", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateTable( | ||||
|                 name: "PastVisit", | ||||
|                 columns: table => new | ||||
|                 { | ||||
|                     VisaApplicationId = table.Column<Guid>(type: "uuid", nullable: false), | ||||
|                     Id = table.Column<int>(type: "integer", nullable: false) | ||||
|                         .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), | ||||
|                     StartDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     EndDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), | ||||
|                     DestinationCountry = table.Column<string>(type: "character varying(70)", unicode: false, maxLength: 70, nullable: false) | ||||
|                 }, | ||||
|                 constraints: table => | ||||
|                 { | ||||
|                     table.PrimaryKey("PK_PastVisit", x => new { x.VisaApplicationId, x.Id }); | ||||
|                     table.ForeignKey( | ||||
|                         name: "FK_PastVisit_VisaApplication_VisaApplicationId", | ||||
|                         column: x => x.VisaApplicationId, | ||||
|                         principalTable: "VisaApplication", | ||||
|                         principalColumn: "Id", | ||||
|                         onDelete: ReferentialAction.Cascade); | ||||
|                 }); | ||||
|  | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_Applicant_PlaceOfWorkId", | ||||
|                 table: "Applicant", | ||||
|                 column: "PlaceOfWorkId"); | ||||
|  | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_Applicant_UserId", | ||||
|                 table: "Applicant", | ||||
|                 column: "UserId", | ||||
|                 unique: true); | ||||
|  | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_User_Email", | ||||
|                 table: "User", | ||||
|                 column: "Email", | ||||
|                 unique: true); | ||||
|  | ||||
|             migrationBuilder.CreateIndex( | ||||
|                 name: "IX_VisaApplication_ApplicantId", | ||||
|                 table: "VisaApplication", | ||||
|                 column: "ApplicantId"); | ||||
|         } | ||||
|  | ||||
|         /// <inheritdoc /> | ||||
|         protected override void Down(MigrationBuilder migrationBuilder) | ||||
|         { | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "PastVisa"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "PastVisit"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "VisaApplication"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "Applicant"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "PlaceOfWork"); | ||||
|  | ||||
|             migrationBuilder.DropTable( | ||||
|                 name: "User"); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,499 @@ | ||||
| // <auto-generated /> | ||||
| using System; | ||||
| using Infrastructure.Database; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Microsoft.EntityFrameworkCore.Infrastructure; | ||||
| using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||||
| using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; | ||||
|  | ||||
| #nullable disable | ||||
|  | ||||
| namespace Infrastructure.Migrations | ||||
| { | ||||
|     [DbContext(typeof(DatabaseContext))] | ||||
|     partial class DatabaseContextModelSnapshot : ModelSnapshot | ||||
|     { | ||||
|         protected override void BuildModel(ModelBuilder modelBuilder) | ||||
|         { | ||||
| #pragma warning disable 612, 618 | ||||
|             modelBuilder | ||||
|                 .HasAnnotation("ProductVersion", "9.0.2") | ||||
|                 .HasAnnotation("Relational:MaxIdentifierLength", 63); | ||||
|  | ||||
|             NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.Applicant", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<DateTime>("BirthDate") | ||||
|                         .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                     b.Property<string>("Citizenship") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(30) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(30)"); | ||||
|  | ||||
|                     b.Property<string>("CitizenshipByBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(30) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(30)"); | ||||
|  | ||||
|                     b.Property<string>("CityOfBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<string>("CountryOfBirth") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<int>("Gender") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<bool>("IsNonResident") | ||||
|                         .HasColumnType("boolean"); | ||||
|  | ||||
|                     b.Property<string>("JobTitle") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(50) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                     b.Property<int>("MaritalStatus") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<Guid>("PlaceOfWorkId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<Guid>("UserId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("PlaceOfWorkId"); | ||||
|  | ||||
|                     b.HasIndex("UserId") | ||||
|                         .IsUnique(); | ||||
|  | ||||
|                     b.ToTable("Applicant"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.PlaceOfWork", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("Name") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(200) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                     b.Property<string>("PhoneNum") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(13) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(13)"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.ToTable("PlaceOfWork"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.Users.User", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("Email") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(254) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(254)"); | ||||
|  | ||||
|                     b.Property<string>("Password") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(50) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                     b.Property<int>("Role") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("Email") | ||||
|                         .IsUnique(); | ||||
|  | ||||
|                     b.ToTable("User"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.VisaApplicationDomain.VisaApplication", b => | ||||
|                 { | ||||
|                     b.Property<Guid>("Id") | ||||
|                         .ValueGeneratedOnAdd() | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<Guid>("ApplicantId") | ||||
|                         .HasColumnType("uuid"); | ||||
|  | ||||
|                     b.Property<string>("DestinationCountry") | ||||
|                         .IsRequired() | ||||
|                         .HasMaxLength(70) | ||||
|                         .IsUnicode(false) | ||||
|                         .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                     b.Property<bool>("ForGroup") | ||||
|                         .HasColumnType("boolean"); | ||||
|  | ||||
|                     b.Property<DateTime>("RequestDate") | ||||
|                         .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                     b.Property<int>("RequestedNumberOfEntries") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("Status") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("ValidDaysRequested") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.Property<int>("VisaCategory") | ||||
|                         .HasColumnType("integer"); | ||||
|  | ||||
|                     b.HasKey("Id"); | ||||
|  | ||||
|                     b.HasIndex("ApplicantId"); | ||||
|  | ||||
|                     b.ToTable("VisaApplication"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.Applicant", b => | ||||
|                 { | ||||
|                     b.HasOne("Domains.ApplicantDomain.PlaceOfWork", "PlaceOfWork") | ||||
|                         .WithMany() | ||||
|                         .HasForeignKey("PlaceOfWorkId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.HasOne("Domains.Users.User", null) | ||||
|                         .WithOne() | ||||
|                         .HasForeignKey("Domains.ApplicantDomain.Applicant", "UserId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "FatherName", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "MotherName", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Name", "Name", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("FirstName") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Patronymic") | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.Property<string>("Surname") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(50) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(50)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Passport", "Passport", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("ApplicantId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("IssueDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Issuer") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(200) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                             b1.Property<string>("Number") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(20) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(20)"); | ||||
|  | ||||
|                             b1.HasKey("ApplicantId"); | ||||
|  | ||||
|                             b1.ToTable("Applicant"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("ApplicantId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("FatherName") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("MotherName") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("Name") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("Passport") | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.Navigation("PlaceOfWork"); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.ApplicantDomain.PlaceOfWork", b => | ||||
|                 { | ||||
|                     b.OwnsOne("Domains.ApplicantDomain.Address", "Address", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("PlaceOfWorkId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<string>("Building") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(10) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(10)"); | ||||
|  | ||||
|                             b1.Property<string>("City") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<string>("Country") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<string>("Street") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(100) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(100)"); | ||||
|  | ||||
|                             b1.HasKey("PlaceOfWorkId"); | ||||
|  | ||||
|                             b1.ToTable("PlaceOfWork"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("PlaceOfWorkId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("Address") | ||||
|                         .IsRequired(); | ||||
|                 }); | ||||
|  | ||||
|             modelBuilder.Entity("Domains.VisaApplicationDomain.VisaApplication", b => | ||||
|                 { | ||||
|                     b.HasOne("Domains.ApplicantDomain.Applicant", null) | ||||
|                         .WithMany() | ||||
|                         .HasForeignKey("ApplicantId") | ||||
|                         .OnDelete(DeleteBehavior.Cascade) | ||||
|                         .IsRequired(); | ||||
|  | ||||
|                     b.OwnsMany("Domains.VisaApplicationDomain.PastVisa", "PastVisas", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<int>("Id") | ||||
|                                 .ValueGeneratedOnAdd() | ||||
|                                 .HasColumnType("integer"); | ||||
|  | ||||
|                             NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id")); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("IssueDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Name") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId", "Id"); | ||||
|  | ||||
|                             b1.ToTable("PastVisa"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsMany("Domains.VisaApplicationDomain.PastVisit", "PastVisits", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<int>("Id") | ||||
|                                 .ValueGeneratedOnAdd() | ||||
|                                 .HasColumnType("integer"); | ||||
|  | ||||
|                             NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id")); | ||||
|  | ||||
|                             b1.Property<string>("DestinationCountry") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(70) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(70)"); | ||||
|  | ||||
|                             b1.Property<DateTime>("EndDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<DateTime>("StartDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId", "Id"); | ||||
|  | ||||
|                             b1.ToTable("PastVisit"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.VisaApplicationDomain.PermissionToDestCountry", "PermissionToDestCountry", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Issuer") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(200) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(200)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId"); | ||||
|  | ||||
|                             b1.ToTable("VisaApplication"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.OwnsOne("Domains.VisaApplicationDomain.ReentryPermit", "ReentryPermit", b1 => | ||||
|                         { | ||||
|                             b1.Property<Guid>("VisaApplicationId") | ||||
|                                 .HasColumnType("uuid"); | ||||
|  | ||||
|                             b1.Property<DateTime>("ExpirationDate") | ||||
|                                 .HasColumnType("timestamp with time zone"); | ||||
|  | ||||
|                             b1.Property<string>("Number") | ||||
|                                 .IsRequired() | ||||
|                                 .HasMaxLength(25) | ||||
|                                 .IsUnicode(false) | ||||
|                                 .HasColumnType("character varying(25)"); | ||||
|  | ||||
|                             b1.HasKey("VisaApplicationId"); | ||||
|  | ||||
|                             b1.ToTable("VisaApplication"); | ||||
|  | ||||
|                             b1.WithOwner() | ||||
|                                 .HasForeignKey("VisaApplicationId"); | ||||
|                         }); | ||||
|  | ||||
|                     b.Navigation("PastVisas"); | ||||
|  | ||||
|                     b.Navigation("PastVisits"); | ||||
|  | ||||
|                     b.Navigation("PermissionToDestCountry"); | ||||
|  | ||||
|                     b.Navigation("ReentryPermit"); | ||||
|                 }); | ||||
| #pragma warning restore 612, 618 | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user