Upload project.

This commit is contained in:
StevenJW
2020-06-07 22:36:12 +01:00
parent 0df30b8f36
commit 5829fb5504
170 changed files with 31989 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Venues.Data;
namespace ThAmCo.Catering.Migrations
{
[DbContext(typeof(CateringDbContext))]
[Migration("20181204120817_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("thamco.catering")
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Catering.Data.FoodBooking", b =>
{
b.Property<int>("Id");
b.Property<int>("MenuId");
b.Property<string>("Notes");
b.HasKey("Id");
b.ToTable("FoodBookings");
});
modelBuilder.Entity("ThAmCo.Catering.Data.Menu", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Items");
b.Property<double>("Price");
b.HasKey("Id");
b.ToTable("Menus");
b.HasData(
new { Id = 1, Items = "Chicken Pate, Chicken Roast, Chicken Cake", Price = 8.5 },
new { Id = 2, Items = "Toast, Cheese On Toast, Jam on Toast", Price = 7.5 },
new { Id = 3, Items = "Mac and Cheese, Alan's Special, Cheesecake", Price = 9.0 }
);
});
modelBuilder.Entity("ThAmCo.Catering.Data.FoodBooking", b =>
{
b.HasOne("ThAmCo.Catering.Data.Menu", "Menu")
.WithMany("FoodBookings")
.HasForeignKey("Id")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,79 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Catering.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "thamco.catering");
migrationBuilder.CreateTable(
name: "Menus",
schema: "thamco.catering",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
Items = table.Column<string>(nullable: true),
Price = table.Column<double>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Menus", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FoodBookings",
schema: "thamco.catering",
columns: table => new
{
Id = table.Column<int>(nullable: false),
MenuId = table.Column<int>(nullable: false),
Notes = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FoodBookings", x => x.Id);
table.ForeignKey(
name: "FK_FoodBookings_Menus_Id",
column: x => x.Id,
principalSchema: "thamco.catering",
principalTable: "Menus",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
schema: "thamco.catering",
table: "Menus",
columns: new[] { "Id", "Items", "Price" },
values: new object[] { 1, "Chicken Pate, Chicken Roast, Chicken Cake", 8.5 });
migrationBuilder.InsertData(
schema: "thamco.catering",
table: "Menus",
columns: new[] { "Id", "Items", "Price" },
values: new object[] { 2, "Toast, Cheese On Toast, Jam on Toast", 7.5 });
migrationBuilder.InsertData(
schema: "thamco.catering",
table: "Menus",
columns: new[] { "Id", "Items", "Price" },
values: new object[] { 3, "Mac and Cheese, Alan's Special, Cheesecake", 9.0 });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FoodBookings",
schema: "thamco.catering");
migrationBuilder.DropTable(
name: "Menus",
schema: "thamco.catering");
}
}
}

View File

@@ -0,0 +1,66 @@
// <auto-generated />
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Venues.Data;
namespace ThAmCo.Catering.Migrations
{
[DbContext(typeof(CateringDbContext))]
partial class CateringDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("thamco.catering")
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Catering.Data.FoodBooking", b =>
{
b.Property<int>("Id");
b.Property<int>("MenuId");
b.Property<string>("Notes");
b.HasKey("Id");
b.ToTable("FoodBookings");
});
modelBuilder.Entity("ThAmCo.Catering.Data.Menu", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("Items");
b.Property<double>("Price");
b.HasKey("Id");
b.ToTable("Menus");
b.HasData(
new { Id = 1, Items = "Chicken Pate, Chicken Roast, Chicken Cake", Price = 8.5 },
new { Id = 2, Items = "Toast, Cheese On Toast, Jam on Toast", Price = 7.5 },
new { Id = 3, Items = "Mac and Cheese, Alan's Special, Cheesecake", Price = 9.0 }
);
});
modelBuilder.Entity("ThAmCo.Catering.Data.FoodBooking", b =>
{
b.HasOne("ThAmCo.Catering.Data.Menu", "Menu")
.WithMany("FoodBookings")
.HasForeignKey("Id")
.OnDelete(DeleteBehavior.Cascade);
});
#pragma warning restore 612, 618
}
}
}