From dbc5ccfc43c26b127b99505e733794a7c5ef3ad0 Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 29 Nov 2021 12:33:08 +0200 Subject: [PATCH] Deleted migrations --- ...1122142029_AddedWorkshopImages.Designer.cs | 1465 ----------------- .../20211122142029_AddedWorkshopImages.cs | 63 - .../OutOfSchoolDbContextModelSnapshot.cs | 59 - 3 files changed, 1587 deletions(-) delete mode 100644 OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.Designer.cs delete mode 100644 OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.cs diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.Designer.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.Designer.cs deleted file mode 100644 index c1f66ff154..0000000000 --- a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.Designer.cs +++ /dev/null @@ -1,1465 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using OutOfSchool.Services; - -namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations -{ - [DbContext(typeof(OutOfSchoolDbContext))] - [Migration("20211122142029_AddedWorkshopImages")] - partial class AddedWorkshopImages - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseIdentityColumns() - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.2"); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .IsUnicode(false) - .HasColumnType("char(36)") - .IsFixedLength(true); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .UseIdentityColumn(); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("BuildingNumber") - .IsRequired() - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.Property("City") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("District") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Region") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Street") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.HasKey("Id"); - - b.ToTable("Addresses"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Application", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ChildId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreationTime") - .HasColumnType("datetimeoffset"); - - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - - b.Property("Status") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1); - - b.Property("WorkshopId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("ChildId"); - - b.HasIndex("ParentId"); - - b.HasIndex("WorkshopId"); - - b.ToTable("Applications"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ChatRoomId") - .HasColumnType("uniqueidentifier"); - - b.Property("CreatedTime") - .HasColumnType("datetimeoffset"); - - b.Property("IsRead") - .HasColumnType("bit"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("ChatRoomId"); - - b.HasIndex("UserId"); - - b.ToTable("ChatMessages"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatRoom", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("WorkshopId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("WorkshopId"); - - b.ToTable("ChatRooms"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatRoomUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ChatRoomId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("ChatRoomId"); - - b.HasIndex("UserId"); - - b.ToTable("ChatRoomUsers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Child", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateOfBirth") - .HasColumnType("date"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Gender") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("MiddleName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - - b.Property("PlaceOfStudy") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("SocialGroupId") - .HasColumnType("bigint"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("ParentId"); - - b.HasIndex("SocialGroupId"); - - b.ToTable("Children"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.City", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("District") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Region") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.HasKey("Id"); - - b.ToTable("Cities"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Class", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("DepartmentId") - .HasColumnType("bigint"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("DepartmentId"); - - b.ToTable("Classes"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.DateTimeRange", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("EndTime") - .HasColumnType("time"); - - b.Property("StartTime") - .HasColumnType("time"); - - b.Property("Workdays") - .HasColumnType("tinyint"); - - b.Property("WorkshopId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("WorkshopId"); - - b.ToTable("DateTimeRanges"); - - b.HasCheckConstraint("CK_DateTimeRanges_EndTimeIsAfterStartTime", "[EndTime] >= [StartTime]"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Department", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("DirectionId") - .HasColumnType("bigint"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.HasIndex("DirectionId"); - - b.ToTable("Departments"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Direction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.HasKey("Id"); - - b.ToTable("Directions"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Favorite", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("WorkshopId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("WorkshopId"); - - b.ToTable("Favorites"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Images.Image", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ImageId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id", "ImageId"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("WorkshopImages"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Images.ImageMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("StorageId") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("ImagesMetadata"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.InstitutionStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("InstitutionStatuses"); - - b.HasData( - new - { - Id = 1L, - Name = "Працює" - }, - new - { - Id = 2L, - Name = "Перебуває в стані реорганізації" - }, - new - { - Id = 3L, - Name = "Має намір на реорганізацію" - }); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Parents"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.PermissionsForRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("Description") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("PackedPermissions") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("RoleName") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("Id"); - - b.ToTable("PermissionsForRoles"); - - b.HasData( - new - { - Id = 1L, - Description = "admin permissions", - PackedPermissions = "de\n \r  !()+4325>== - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ActualAddressId") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .IsUnicode(true) - .HasColumnType("nvarchar(500)"); - - b.Property("Director") - .HasMaxLength(50) - .IsUnicode(true) - .HasColumnType("nvarchar(50)"); - - b.Property("DirectorDateOfBirth") - .HasColumnType("Date"); - - b.Property("EdrpouIpn") - .HasMaxLength(12) - .HasColumnType("bigint"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Facebook") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Founder") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("FullTitle") - .IsRequired() - .HasMaxLength(60) - .IsUnicode(true) - .HasColumnType("nvarchar(60)"); - - b.Property("Instagram") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("InstitutionStatusId") - .HasColumnType("bigint"); - - b.Property("LegalAddressId") - .HasColumnType("bigint"); - - b.Property("Ownership") - .HasColumnType("int"); - - b.Property("PhoneNumber") - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.Property("ShortTitle") - .IsRequired() - .HasMaxLength(60) - .IsUnicode(true) - .HasColumnType("nvarchar(60)"); - - b.Property("Status") - .HasColumnType("bit"); - - b.Property("Type") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.Property("Website") - .HasMaxLength(256) - .IsUnicode(true) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("ActualAddressId"); - - b.HasIndex("InstitutionStatusId"); - - b.HasIndex("LegalAddressId"); - - b.HasIndex("UserId"); - - b.ToTable("Providers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Rating", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("CreationTime") - .HasColumnType("datetimeoffset"); - - b.Property("EntityId") - .HasColumnType("uniqueidentifier"); - - b.Property("ParentId") - .HasColumnType("uniqueidentifier"); - - b.Property("Rate") - .HasColumnType("int"); - - b.Property("Type") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.ToTable("Ratings"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.SocialGroup", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .UseIdentityColumn(); - - b.Property("Name") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("SocialGroups"); - - b.HasData( - new - { - Id = 1L, - Name = "Діти із багатодітних сімей" - }, - new - { - Id = 2L, - Name = "Діти із малозабезпечених сімей" - }, - new - { - Id = 3L, - Name = "Діти з інвалідністю" - }, - new - { - Id = 4L, - Name = "Діти-сироти" - }, - new - { - Id = 5L, - Name = "Діти, позбавлені батьківського піклування" - }); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Teacher", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateOfBirth") - .HasColumnType("date"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("Image") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("MiddleName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("WorkshopId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("WorkshopId"); - - b.ToTable("Teachers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.User", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .IsUnicode(false) - .HasColumnType("char(36)") - .IsFixedLength(true); - - b.Property("CreatingTime") - .HasColumnType("datetimeoffset"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("IsRegistered") - .HasColumnType("bit"); - - b.Property("LastLogin") - .HasColumnType("datetimeoffset"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MiddleName") - .HasMaxLength(30) - .HasColumnType("nvarchar(30)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasMaxLength(84) - .IsUnicode(false) - .HasColumnType("char(84)") - .IsFixedLength(true); - - b.Property("PhoneNumber") - .HasMaxLength(15) - .IsUnicode(false) - .HasColumnType("varchar(15)") - .IsFixedLength(false); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("Role") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("SecurityStamp") - .IsRequired() - .HasMaxLength(36) - .IsUnicode(false) - .HasColumnType("varchar(36)") - .IsFixedLength(false); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AddressId") - .HasColumnType("bigint"); - - b.Property("ClassId") - .HasColumnType("bigint"); - - b.Property("DepartmentId") - .HasColumnType("bigint"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("DirectionId") - .HasColumnType("bigint"); - - b.Property("DisabilityOptionsDesc") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Facebook") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("Head") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("HeadDateOfBirth") - .HasColumnType("date"); - - b.Property("Instagram") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("IsPerMonth") - .HasColumnType("bit"); - - b.Property("Keywords") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Logo") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("MaxAge") - .HasColumnType("int"); - - b.Property("MinAge") - .HasColumnType("int"); - - b.Property("Phone") - .IsRequired() - .HasMaxLength(15) - .HasColumnType("nvarchar(15)"); - - b.Property("Price") - .HasColumnType("decimal(18,2)"); - - b.Property("ProviderId") - .HasColumnType("uniqueidentifier"); - - b.Property("ProviderTitle") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Website") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("WithDisabilityOptions") - .HasColumnType("bit"); - - b.HasKey("Id") - .IsClustered(false); - - b.HasIndex("AddressId"); - - b.HasIndex("ClassId"); - - b.HasIndex("DirectionId"); - - b.HasIndex("ProviderId"); - - b.ToTable("Workshops"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("OutOfSchool.Services.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("OutOfSchool.Services.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("OutOfSchool.Services.Models.User", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Application", b => - { - b.HasOne("OutOfSchool.Services.Models.Child", "Child") - .WithMany() - .HasForeignKey("ChildId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Parent", "Parent") - .WithMany() - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Workshop", "Workshop") - .WithMany("Applications") - .HasForeignKey("WorkshopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Child"); - - b.Navigation("Parent"); - - b.Navigation("Workshop"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatMessage", b => - { - b.HasOne("OutOfSchool.Services.Models.ChatRoom", "ChatRoom") - .WithMany("ChatMessages") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.User", "User") - .WithMany("ChatMessages") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ChatRoom"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatRoom", b => - { - b.HasOne("OutOfSchool.Services.Models.Workshop", "Workshop") - .WithMany("ChatRooms") - .HasForeignKey("WorkshopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Workshop"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatRoomUser", b => - { - b.HasOne("OutOfSchool.Services.Models.ChatRoom", "ChatRoom") - .WithMany("ChatRoomUsers") - .HasForeignKey("ChatRoomId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.User", "User") - .WithMany("ChatRoomUsers") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ChatRoom"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Child", b => - { - b.HasOne("OutOfSchool.Services.Models.Parent", "Parent") - .WithMany("Children") - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.SocialGroup", "SocialGroup") - .WithMany("Children") - .HasForeignKey("SocialGroupId"); - - b.Navigation("Parent"); - - b.Navigation("SocialGroup"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Class", b => - { - b.HasOne("OutOfSchool.Services.Models.Department", "Department") - .WithMany("Classes") - .HasForeignKey("DepartmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Department"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.DateTimeRange", b => - { - b.HasOne("OutOfSchool.Services.Models.Workshop", null) - .WithMany("DateTimeRanges") - .HasForeignKey("WorkshopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Department", b => - { - b.HasOne("OutOfSchool.Services.Models.Direction", "Direction") - .WithMany("Departments") - .HasForeignKey("DirectionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Direction"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Favorite", b => - { - b.HasOne("OutOfSchool.Services.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Workshop", "Workshop") - .WithMany() - .HasForeignKey("WorkshopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - - b.Navigation("Workshop"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Images.Image", b => - { - b.HasOne("OutOfSchool.Services.Models.Workshop", "Entity") - .WithMany("WorkshopImages") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Images.ImageMetadata", "ImageMetadata") - .WithOne("WorkshopImage") - .HasForeignKey("OutOfSchool.Services.Models.Images.Image", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Entity"); - - b.Navigation("ImageMetadata"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => - { - b.HasOne("OutOfSchool.Services.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Provider", b => - { - b.HasOne("OutOfSchool.Services.Models.Address", "ActualAddress") - .WithMany() - .HasForeignKey("ActualAddressId"); - - b.HasOne("OutOfSchool.Services.Models.InstitutionStatus", "InstitutionStatus") - .WithMany("Providers") - .HasForeignKey("InstitutionStatusId"); - - b.HasOne("OutOfSchool.Services.Models.Address", "LegalAddress") - .WithMany() - .HasForeignKey("LegalAddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ActualAddress"); - - b.Navigation("InstitutionStatus"); - - b.Navigation("LegalAddress"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Rating", b => - { - b.HasOne("OutOfSchool.Services.Models.Parent", "Parent") - .WithMany() - .HasForeignKey("ParentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Parent"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Teacher", b => - { - b.HasOne("OutOfSchool.Services.Models.Workshop", "Workshop") - .WithMany("Teachers") - .HasForeignKey("WorkshopId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Workshop"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => - { - b.HasOne("OutOfSchool.Services.Models.Address", "Address") - .WithMany() - .HasForeignKey("AddressId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Class", "Class") - .WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Direction", "Direction") - .WithMany() - .HasForeignKey("DirectionId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Provider", "Provider") - .WithMany("Workshops") - .HasForeignKey("ProviderId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Address"); - - b.Navigation("Class"); - - b.Navigation("Direction"); - - b.Navigation("Provider"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.ChatRoom", b => - { - b.Navigation("ChatMessages"); - - b.Navigation("ChatRoomUsers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Department", b => - { - b.Navigation("Classes"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Direction", b => - { - b.Navigation("Departments"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Images.ImageMetadata", b => - { - b.Navigation("WorkshopImage"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.InstitutionStatus", b => - { - b.Navigation("Providers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Provider", b => - { - b.Navigation("Workshops"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.SocialGroup", b => - { - b.Navigation("Children"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.User", b => - { - b.Navigation("ChatMessages"); - - b.Navigation("ChatRoomUsers"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Workshop", b => - { - b.Navigation("Applications"); - - b.Navigation("ChatRooms"); - - b.Navigation("DateTimeRanges"); - - b.Navigation("Teachers"); - - b.Navigation("WorkshopImages"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.cs deleted file mode 100644 index f5107d2387..0000000000 --- a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/20211122142029_AddedWorkshopImages.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace OutOfSchool.IdentityServer.Data.Migrations.OutOfSchoolMigrations -{ - public partial class AddedWorkshopImages : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ImagesMetadata", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - StorageId = table.Column(type: "nvarchar(max)", nullable: true), - ContentType = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_ImagesMetadata", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "WorkshopImages", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ImageId = table.Column(type: "uniqueidentifier", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_WorkshopImages", x => new { x.Id, x.ImageId }); - table.ForeignKey( - name: "FK_WorkshopImages_ImagesMetadata_ImageId", - column: x => x.ImageId, - principalTable: "ImagesMetadata", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_WorkshopImages_Workshops_Id", - column: x => x.Id, - principalTable: "Workshops", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_WorkshopImages_ImageId", - table: "WorkshopImages", - column: "ImageId", - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "WorkshopImages"); - - migrationBuilder.DropTable( - name: "ImagesMetadata"); - } - } -} diff --git a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs index cd5874d590..40934116d8 100644 --- a/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs +++ b/OutOfSchool/OutOfSchool.IdentityServer/Data/Migrations/OutOfSchoolMigrations/OutOfSchoolDbContextModelSnapshot.cs @@ -525,39 +525,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("Favorites"); }); - modelBuilder.Entity("OutOfSchool.Services.Models.Images.Image", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("ImageId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id", "ImageId"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("WorkshopImages"); - }); - - modelBuilder.Entity("OutOfSchool.Services.Models.Images.ImageMetadata", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("StorageId") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("ImagesMetadata"); - }); - modelBuilder.Entity("OutOfSchool.Services.Models.InstitutionStatus", b => { b.Property("Id") @@ -1278,25 +1245,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Workshop"); }); - modelBuilder.Entity("OutOfSchool.Services.Models.Images.Image", b => - { - b.HasOne("OutOfSchool.Services.Models.Workshop", "Entity") - .WithMany("WorkshopImages") - .HasForeignKey("Id") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("OutOfSchool.Services.Models.Images.ImageMetadata", "ImageMetadata") - .WithOne("WorkshopImage") - .HasForeignKey("OutOfSchool.Services.Models.Images.Image", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Entity"); - - b.Navigation("ImageMetadata"); - }); - modelBuilder.Entity("OutOfSchool.Services.Models.Parent", b => { b.HasOne("OutOfSchool.Services.Models.User", "User") @@ -1413,11 +1361,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Departments"); }); - modelBuilder.Entity("OutOfSchool.Services.Models.Images.ImageMetadata", b => - { - b.Navigation("WorkshopImage"); - }); - modelBuilder.Entity("OutOfSchool.Services.Models.InstitutionStatus", b => { b.Navigation("Providers"); @@ -1454,8 +1397,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("DateTimeRanges"); b.Navigation("Teachers"); - - b.Navigation("WorkshopImages"); }); #pragma warning restore 612, 618 }