// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using ThAmCo.Events.Data; namespace ThAmCo.Events.Data.Migrations { [DbContext(typeof(EventsDbContext))] [Migration("20181205125146_AddSoftDeleteCustomer")] partial class AddSoftDeleteCustomer { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasDefaultSchema("thamco.events") .HasAnnotation("ProductVersion", "2.2.0-preview3-35497") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("ThAmCo.Events.Data.Customer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("Email") .IsRequired(); b.Property("FirstName") .IsRequired(); b.Property("IsDeleted"); b.Property("Surname") .IsRequired(); b.HasKey("Id"); b.ToTable("Customers"); b.HasData( new { Id = 1, Email = "bob@example.com", FirstName = "Robert", IsDeleted = false, Surname = "Robertson" }, new { Id = 2, Email = "betty@example.com", FirstName = "Betty", IsDeleted = false, Surname = "Thornton" }, new { Id = 3, Email = "jin@example.com", FirstName = "Jin", IsDeleted = false, Surname = "Jellybeans" }); }); modelBuilder.Entity("ThAmCo.Events.Data.Event", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("Date"); b.Property("Duration"); b.Property("FoodReference"); b.Property("IsDeleted"); b.Property("Title") .IsRequired(); b.Property("TypeId") .IsRequired() .IsFixedLength(true) .HasMaxLength(3); b.Property("VenueReference"); b.HasKey("Id"); b.ToTable("Events"); b.HasData( new { Id = 1, Date = new DateTime(2016, 4, 12, 0, 0, 0, 0, DateTimeKind.Unspecified), Duration = new TimeSpan(0, 6, 0, 0, 0), FoodReference = 0, IsDeleted = false, Title = "Bob's Big 50", TypeId = "PTY" }, new { Id = 2, Date = new DateTime(2018, 12, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), Duration = new TimeSpan(0, 12, 0, 0, 0), FoodReference = 0, IsDeleted = false, Title = "Best Wedding Yet", TypeId = "WED" }); }); modelBuilder.Entity("ThAmCo.Events.Data.GuestBooking", b => { b.Property("CustomerId"); b.Property("EventId"); b.Property("Attended"); b.HasKey("CustomerId", "EventId"); b.HasIndex("EventId"); b.ToTable("Guests"); b.HasData( new { CustomerId = 1, EventId = 1, Attended = true }, new { CustomerId = 2, EventId = 1, Attended = false }, new { CustomerId = 1, EventId = 2, Attended = false }, new { CustomerId = 3, EventId = 2, Attended = false }); }); modelBuilder.Entity("ThAmCo.Events.Data.Staff", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); b.Property("Email") .IsRequired(); b.Property("FirstAid"); b.Property("FirstName") .IsRequired(); b.Property("Surname") .IsRequired(); b.HasKey("Id"); b.ToTable("Staff"); b.HasData( new { Id = 1, Email = "a@a.a", FirstAid = false, FirstName = "Alan", Surname = "Partridge" }, new { Id = 2, Email = "rege@hotmail.com", FirstAid = true, FirstName = "Roger", Surname = "Stephenson" }, new { Id = 3, Email = "alans@jims.net", FirstAid = false, FirstName = "Alans", Surname = "Smith" }); }); modelBuilder.Entity("ThAmCo.Events.Data.Staffing", b => { b.Property("StaffId"); b.Property("EventId"); b.HasKey("StaffId", "EventId"); b.HasIndex("EventId"); b.ToTable("Staffing"); b.HasData( new { StaffId = 1, EventId = 2 }, new { StaffId = 2, EventId = 1 }, new { StaffId = 3, EventId = 1 }); }); modelBuilder.Entity("ThAmCo.Events.Data.GuestBooking", b => { b.HasOne("ThAmCo.Events.Data.Customer", "Customer") .WithMany("Bookings") .HasForeignKey("CustomerId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("ThAmCo.Events.Data.Event", "Event") .WithMany("Bookings") .HasForeignKey("EventId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("ThAmCo.Events.Data.Staffing", b => { b.HasOne("ThAmCo.Events.Data.Event", "Event") .WithMany("Staffings") .HasForeignKey("EventId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("ThAmCo.Events.Data.Staff", "Staff") .WithMany("Staffings") .HasForeignKey("StaffId") .OnDelete(DeleteBehavior.Cascade); }); #pragma warning restore 612, 618 } } }