Y2S1-Web_Apps_and_Services/ThAmCo.Events/Data/Migrations/20181205125146_AddSoftDeleteCustomer.Designer.cs

272 lines
9.4 KiB
C#
Raw Normal View History

2020-06-07 21:36:12 +00:00
// <auto-generated />
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<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Email")
.IsRequired();
b.Property<string>("FirstName")
.IsRequired();
b.Property<bool>("IsDeleted");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<TimeSpan?>("Duration");
b.Property<int>("FoodReference");
b.Property<bool>("IsDeleted");
b.Property<string>("Title")
.IsRequired();
b.Property<string>("TypeId")
.IsRequired()
.IsFixedLength(true)
.HasMaxLength(3);
b.Property<string>("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<int>("CustomerId");
b.Property<int>("EventId");
b.Property<bool>("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<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Email")
.IsRequired();
b.Property<bool>("FirstAid");
b.Property<string>("FirstName")
.IsRequired();
b.Property<string>("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<int>("StaffId");
b.Property<int>("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
}
}
}