263 lines
9.0 KiB
C#
263 lines
9.0 KiB
C#
|
// <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("20181204160544_AddFoodReference")]
|
|||
|
partial class AddFoodReference
|
|||
|
{
|
|||
|
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<string>("Surname")
|
|||
|
.IsRequired();
|
|||
|
|
|||
|
b.HasKey("Id");
|
|||
|
|
|||
|
b.ToTable("Customers");
|
|||
|
|
|||
|
b.HasData(
|
|||
|
new
|
|||
|
{
|
|||
|
Id = 1,
|
|||
|
Email = "bob@example.com",
|
|||
|
FirstName = "Robert",
|
|||
|
Surname = "Robertson"
|
|||
|
},
|
|||
|
new
|
|||
|
{
|
|||
|
Id = 2,
|
|||
|
Email = "betty@example.com",
|
|||
|
FirstName = "Betty",
|
|||
|
Surname = "Thornton"
|
|||
|
},
|
|||
|
new
|
|||
|
{
|
|||
|
Id = 3,
|
|||
|
Email = "jin@example.com",
|
|||
|
FirstName = "Jin",
|
|||
|
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<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,
|
|||
|
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,
|
|||
|
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
|
|||
|
}
|
|||
|
}
|
|||
|
}
|