From 2bf5d8640a23f092f5240c8442a3bc98840533cc Mon Sep 17 00:00:00 2001 From: ChrisRollings Date: Sat, 23 Mar 2019 14:57:57 +0000 Subject: [PATCH] Created linking table --- .../Controllers/EventController.cs | 4 +- Code/groupH_M32COM.Angular/DROPDBSTUFF.sql | 14 + Code/groupH_M32COM.Angular/DTO/EventsDTO.cs | 12 +- .../DatabaseClasses/RCBoatDBContext.cs | 261 +++++++++------- .../DatabaseClasses/RCBoatRepository.cs | 2 +- .../20190322234135_UpdateBuilder.Designer.cs | 279 ------------------ .../20190322234135_UpdateBuilder.cs | 263 ----------------- .../RCBoatDBContextModelSnapshot.cs | 277 ----------------- Code/groupH_M32COM.Angular/Models/Boat.cs | 9 +- .../Models/{EventDetail.cs => Event.cs} | 23 +- .../Models/EventDetailBoat.cs | 14 + .../Models/EventDetailPrizes.cs | 15 + .../Models/EventDetailPromotion.cs | 14 + .../Models/EventPrizes.cs | 8 +- .../groupH_M32COM.Angular/Models/Promotion.cs | 8 +- Code/groupH_M32COM.Angular/Startup.cs | 2 +- Code/groupH_M32COM.Angular/localdatabase.db | Bin 69632 -> 106496 bytes DROPDBSTUFF.sql | 9 + 18 files changed, 259 insertions(+), 955 deletions(-) create mode 100644 Code/groupH_M32COM.Angular/DROPDBSTUFF.sql delete mode 100644 Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.Designer.cs delete mode 100644 Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.cs delete mode 100644 Code/groupH_M32COM.Angular/Migrations/RCBoatDBContextModelSnapshot.cs rename Code/groupH_M32COM.Angular/Models/{EventDetail.cs => Event.cs} (51%) create mode 100644 Code/groupH_M32COM.Angular/Models/EventDetailBoat.cs create mode 100644 Code/groupH_M32COM.Angular/Models/EventDetailPrizes.cs create mode 100644 Code/groupH_M32COM.Angular/Models/EventDetailPromotion.cs create mode 100644 DROPDBSTUFF.sql diff --git a/Code/groupH_M32COM.Angular/Controllers/EventController.cs b/Code/groupH_M32COM.Angular/Controllers/EventController.cs index b32d482..394e1a8 100644 --- a/Code/groupH_M32COM.Angular/Controllers/EventController.cs +++ b/Code/groupH_M32COM.Angular/Controllers/EventController.cs @@ -14,14 +14,16 @@ namespace groupH_M32COM.Angular.Controllers [ApiController] public class EventController : ControllerBase { + private RCBoatDBContext _context; private RCBoatRepository repo; public EventController(RCBoatDBContext context) { + this._context = context; this.repo = new RCBoatRepository(context); } // GET: api/Event - [Authorize] + //[Authorize] [HttpGet] public IEnumerable Get() { diff --git a/Code/groupH_M32COM.Angular/DROPDBSTUFF.sql b/Code/groupH_M32COM.Angular/DROPDBSTUFF.sql new file mode 100644 index 0000000..7370939 --- /dev/null +++ b/Code/groupH_M32COM.Angular/DROPDBSTUFF.sql @@ -0,0 +1,14 @@ +-- Script Date: 23/03/2019 12:33 - ErikEJ.SqlCeScripting version 3.5.2.80 +DROP TABLE [__EFMigrationsHistory]; +DROP TABLE [Boats]; +DROP TABLE [CrewMembers]; +DROP TABLE [EventPrizes]; +DROP TABLE [Events]; +DROP TABLE [Promotions]; +DROP TABLE [Sponsorships]; +DROP TABLE [Locations]; + +DROP TABLE [EventDetailBoat]; +DROP TABLE [EventDetailPrizes]; +DROP TABLE [EventDetailPromotion]; + diff --git a/Code/groupH_M32COM.Angular/DTO/EventsDTO.cs b/Code/groupH_M32COM.Angular/DTO/EventsDTO.cs index f6866b3..f8258d1 100644 --- a/Code/groupH_M32COM.Angular/DTO/EventsDTO.cs +++ b/Code/groupH_M32COM.Angular/DTO/EventsDTO.cs @@ -17,11 +17,11 @@ namespace groupH_M32COM.Angular.DTO public int LocationID { get; set; } public BoatModel EventType { get; set; } public List Promotions { get; set; } - public List Notes { get; set; } + public List Notes { get; set; } public List RegisterdBoats { get; set; } public BoatDTO WinningBoat { get; set; } - public void Inflate(EventDetail eventDetails,RCBoatRepository repo) + public void Inflate(Event eventDetails,RCBoatRepository repo) { this.ID = eventDetails.ID; this.Description = eventDetails.Description; @@ -29,10 +29,10 @@ namespace groupH_M32COM.Angular.DTO this.EndDate = eventDetails.End_Date; this.Location = eventDetails.Location; this.EventType = eventDetails.EventType; - this.Promotions = eventDetails.Promotions.ToList(); - this.Notes = eventDetails.Prizes.ToList(); - this.RegisterdBoats = eventDetails.RegisterdBoats.Select(x => { var boat = new BoatDTO();boat.Inflate(x); return boat; }).ToList(); - this.WinningBoat = repo.GetBoatDTO(eventDetails.WinningBoatId); + //this.Promotions = eventDetails.Promotions.ToList(); + //this.Notes = eventDetails.Prizes.ToList(); + //this.RegisterdBoats = eventDetails.Boats.Select(x => { var boat = new BoatDTO();boat.Inflate(x); return boat; }).ToList(); + //this.WinningBoat = repo.GetBoatDTO(eventDetails.WinningBoatId); } } } diff --git a/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatDBContext.cs b/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatDBContext.cs index 11e3a56..3a2baec 100644 --- a/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatDBContext.cs +++ b/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatDBContext.cs @@ -16,121 +16,74 @@ namespace groupH_M32COM.Angular.DatabaseClasses public DbSet Boats { get; set; } public DbSet CrewMembers { get; set; } - public DbSet Events { get; set; } - public DbSet EventPrizes { get; set; } + public DbSet Events { get; set; } + public DbSet EventPrizes { get; set; } public DbSet Locations { get; set; } public DbSet Promotions { get; set; } public DbSet SponsorShips { get; set; } + public DbSet EventDetailPromotion { get; set; } + public DbSet EventDetailBoat { get; set; } + public DbSet EventDetailPrizes { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { - var promotion = new Promotion() + modelBuilder.Entity(x => { - ID = 1, - Description = "Description", - PromotionalManagerName = "Timmy", - ContactNumber = "54654654", - }; + x.HasKey(bc => new { bc.EventId, bc.PromotionId }); - var location = new Location() - { - ID = 1, - City="Coventry", - Country ="England", - PostCode = "cv19ll" - }; + x.HasOne(bc => bc.Event) + .WithMany(b => b.Promotions) + .HasForeignKey(bc => bc.EventId); - var sponsorship = new SponsorShip() - { - ID = 1, - CompanyName= "Description", - SponsorAmount = 1000, - }; + x.HasOne(bc => bc.Promotion) + .WithMany(c => c.Events) + .HasForeignKey(bc => bc.PromotionId); - var eventPrizes = new EventPrizes() - { - ID = 1, - Note = "Event Note", - PrizeMoney = 1000, - WinningPosition = WinningPositions.First - }; + x.HasData(new EventDetailPromotion() + { + PromotionId = 1, + EventId = 1 + }); + }); - var crewmember1 = new CrewMember() + modelBuilder.Entity(x => { - ID = 1, - FirstName = "Adam", - LastName = "Davis", - Boat = null, - BoatID = 1, - Email = "AdamDavis@G.Com", - DOB = DateTime.Now, - Password = "dadas", - Phone = "14521256", - Role = CrewRole.Captin, - Username = "Captin Davis" - }; - - var crewmember2 = new CrewMember() - { - ID = 2, - FirstName = "Jo", - LastName = "Bob", - Boat = null, - BoatID = 1, - Email = "JoBob@G.Com", - DOB = DateTime.Now, - Password = "dadas", - Phone = "14521256", - Role = CrewRole.BoatEngineer, - Username = "Enginer Jo" - }; - - var crewmember3 = new CrewMember() - { - ID = 3, - FirstName = "Phill", - LastName = "Crack", - Boat = null, - BoatID = 1, - Email = "PhillCrack@G.Com", - DOB = DateTime.Now, - Password = "dadas", - Phone = "14521256", - Role = CrewRole.BoatRecovery, - Username = "Recover Phill" - }; - - var eventDetail = new EventDetail() - { - ID = 1, - Description = "SpeedBoats", - End_Date = DateTime.Now, - StartDate = DateTime.Now, - LocationID = 1, - WinningBoatId =1 - }; - - var boat = new Boat() - { - ID = 1, - Description = "Blue and shiny and very fast ayyyyeeee", - Model = BoatModel.WindPower, - }; + x.HasKey(bc => new { bc.EventId, bc.BoatId }); - modelBuilder.Entity(entity => + x.HasOne(bc => bc.Event) + .WithMany(b => b.Boats) + .HasForeignKey(bc => bc.EventId); + + x.HasOne(bc => bc.Boat) + .WithMany(c => c.Events) + .HasForeignKey(bc => bc.BoatId); + + x.HasData(new EventDetailBoat() { - entity.HasKey(e => e.ID); + BoatId = 1, + EventId = 1 + }); + + }); + + modelBuilder.Entity(x => + { + x.HasKey(bc => new { bc.EventId, bc.PrizeId }); - entity.Property(e => e.Model) - .IsRequired(); + x.HasOne(bc => bc.Event) + .WithMany(b => b.Prizes) + .HasForeignKey(bc => bc.EventId); - entity.Property(e => e.Description) - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); + x.HasOne(bc => bc.Prize) + .WithMany(c => c.Events) + .HasForeignKey(bc => bc.PrizeId); - entity.HasData(boat); + x.HasData(new EventDetailPrizes() + { + PrizeId = 1, + EventId = 1 }); + }); modelBuilder.Entity(entity => { @@ -166,13 +119,52 @@ namespace groupH_M32COM.Angular.DatabaseClasses ; entity.HasData( - crewmember1, - crewmember2, - crewmember3 + new CrewMember() + { + ID = 1, + FirstName = "Adam", + LastName = "Davis", + Boat = null, + BoatID = 1, + Email = "AdamDavis@G.Com", + DOB = DateTime.Now, + Password = "dadas", + Phone = "14521256", + Role = CrewRole.Captin, + Username = "Captin Davis" + }, + new CrewMember() + { + ID = 2, + FirstName = "Jo", + LastName = "Bob", + Boat = null, + BoatID = 1, + Email = "JoBob@G.Com", + DOB = DateTime.Now, + Password = "dadas", + Phone = "14521256", + Role = CrewRole.BoatEngineer, + Username = "Enginer Jo" + }, + new CrewMember() + { + ID = 3, + FirstName = "Phill", + LastName = "Crack", + Boat = null, + BoatID = 1, + Email = "PhillCrack@G.Com", + DOB = DateTime.Now, + Password = "dadas", + Phone = "14521256", + Role = CrewRole.BoatRecovery, + Username = "Recover Phill" + } ); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasKey(e => e.ID); @@ -189,7 +181,15 @@ namespace groupH_M32COM.Angular.DatabaseClasses .IsRequired() ; - entity.HasData(eventDetail); + entity.HasData(new Event() + { + ID = 1, + Description = "SpeedBoats", + End_Date = DateTime.Now, + StartDate = DateTime.Now, + LocationID = 1, + WinningBoatId = 1 + }); }); modelBuilder.Entity(entity => @@ -209,26 +209,39 @@ namespace groupH_M32COM.Angular.DatabaseClasses .IsRequired() ; - - entity.HasData(promotion); + + entity.HasData(new Promotion() + { + ID = 1, + Description = "Description", + PromotionalManagerName = "Timmy", + ContactNumber = "54654654", + }); }); - modelBuilder.Entity(entity => + modelBuilder.Entity(entity => { entity.HasKey(e => e.ID); entity.Property(e => e.ID) - .IsRequired() + .IsRequired() ; entity.Property(e => e.Note) .IsRequired() .HasMaxLength(100) ; + entity.Property(e => e.PrizeMoney) .IsRequired() ; - entity.HasData(eventPrizes); + entity.HasData(new EventPrize() + { + ID = 1, + Note = "Event Note", + PrizeMoney = 1000, + WinningPosition = WinningPositions.First, + }); }); modelBuilder.Entity(entity => @@ -246,7 +259,12 @@ namespace groupH_M32COM.Angular.DatabaseClasses .IsRequired() ; - entity.HasData(sponsorship); + entity.HasData(new SponsorShip() + { + ID = 1, + CompanyName = "Description", + SponsorAmount = 1000, + }); }); modelBuilder.Entity(entity => @@ -268,9 +286,34 @@ namespace groupH_M32COM.Angular.DatabaseClasses .IsRequired() .HasMaxLength(100) ; - entity.HasData(location); + entity.HasData(new Location() + { + ID = 1, + City = "Coventry", + Country = "England", + PostCode = "cv19ll" + }); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ID); + + entity.Property(e => e.Model) + .IsRequired(); + + entity.Property(e => e.Description) + .IsRequired() + .HasMaxLength(100) + .IsUnicode(false); + + entity.HasData(new Boat() + { + ID = 1, + Description = "Blue and shiny and very fast ayyyyeeee", + Model = BoatModel.WindPower, + }); + }); } } } diff --git a/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatRepository.cs b/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatRepository.cs index c9d5201..318c9b4 100644 --- a/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatRepository.cs +++ b/Code/groupH_M32COM.Angular/DatabaseClasses/RCBoatRepository.cs @@ -27,7 +27,7 @@ namespace groupH_M32COM.Angular.DatabaseClasses public EventsDTO GetEventDTO(int id) { - EventDetail eventDetail = this._context.Events.FirstOrDefault(x => x.ID == id); + Event eventDetail = this._context.Events.FirstOrDefault(x => x.ID == id); var DTO = new EventsDTO(); DTO.Inflate(eventDetail, this); return DTO; diff --git a/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.Designer.cs b/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.Designer.cs deleted file mode 100644 index 3747a69..0000000 --- a/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.Designer.cs +++ /dev/null @@ -1,279 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using groupH_M32COM.Angular.DatabaseClasses; - -namespace groupH_M32COM.Angular.Migrations -{ - [DbContext(typeof(RCBoatDBContext))] - [Migration("20190322234135_UpdateBuilder")] - partial class UpdateBuilder - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Boat", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Event_DetailID"); - - b.Property("Model"); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("Boats"); - - b.HasData( - new { ID = 1, Description = "Blue and shiny and very fast ayyyyeeee", Model = 1 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Crew_Member", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("BoatID"); - - b.Property("DOB"); - - b.Property("Email") - .IsRequired(); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Password") - .IsRequired() - .HasMaxLength(10) - .IsUnicode(false); - - b.Property("Phone"); - - b.Property("Role"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(20) - .IsUnicode(false); - - b.HasKey("ID"); - - b.HasIndex("BoatID"); - - b.ToTable("CrewMembers"); - - b.HasData( - new { ID = 1, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "AdamDavis@G.Com", FirstName = "Adam", LastName = "Davis", Password = "dadas", Phone = "14521256", Role = 0, Username = "Captin Davis" }, - new { ID = 2, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "JoBob@G.Com", FirstName = "Jo", LastName = "Bob", Password = "dadas", Phone = "14521256", Role = 1, Username = "Enginer Jo" }, - new { ID = 3, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "PhillCrack@G.Com", FirstName = "Phill", LastName = "Crack", Password = "dadas", Phone = "14521256", Role = 3, Username = "Recover Phill" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Event_Detail", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("End_Date"); - - b.Property("EventType"); - - b.Property("LocationID"); - - b.Property("StartDate"); - - b.Property("WinningBoatId"); - - b.HasKey("ID"); - - b.HasIndex("LocationID"); - - b.ToTable("Events"); - - b.HasData( - new { ID = 1, Description = "SpeedBoats", End_Date = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), EventType = 0, LocationID = 1, StartDate = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), WinningBoatId = 1 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.EventPrizes", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Event_DetailID"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(100); - - b.Property("PrizeMoney"); - - b.Property("WinningPosition"); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("EventPrizes"); - - b.HasData( - new { ID = 1, Note = "Event Note", PrizeMoney = 1000, WinningPosition = 0 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Location", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("City") - .IsRequired() - .HasMaxLength(100); - - b.Property("Country") - .IsRequired() - .HasMaxLength(100); - - b.Property("PostCode") - .IsRequired() - .HasMaxLength(100); - - b.HasKey("ID"); - - b.ToTable("Locations"); - - b.HasData( - new { ID = 1, City = "Coventry", Country = "England", PostCode = "cv19ll" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Promotion", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("ContactNumber") - .IsRequired(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Event_DetailID"); - - b.Property("ImagePath"); - - b.Property("PromotionalManagerName") - .IsRequired(); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("Promotions"); - - b.HasData( - new { ID = 1, ContactNumber = "54654654", Description = "Description", PromotionalManagerName = "Timmy" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.SponsorShip", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("CompanyName") - .IsRequired() - .HasMaxLength(100); - - b.Property("PromotionID"); - - b.Property("SponsorAmount"); - - b.HasKey("ID"); - - b.HasIndex("PromotionID"); - - b.ToTable("SponsorShips"); - - b.HasData( - new { ID = 1, CompanyName = "Description", SponsorAmount = 1000 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Boat", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("RegisterdBoats") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Crew_Member", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Boat", "Boat") - .WithMany("CrewMembers") - .HasForeignKey("BoatID") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Event_Detail", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Location", "Location") - .WithMany() - .HasForeignKey("LocationID") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.EventPrizes", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("Prizes") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Promotion", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("Promotions") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.SponsorShip", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Promotion") - .WithMany("Sponsorships") - .HasForeignKey("PromotionID"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.cs b/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.cs deleted file mode 100644 index 35a2e11..0000000 --- a/Code/groupH_M32COM.Angular/Migrations/20190322234135_UpdateBuilder.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace groupH_M32COM.Angular.Migrations -{ - public partial class UpdateBuilder : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Locations", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - City = table.Column(maxLength: 100, nullable: false), - Country = table.Column(maxLength: 100, nullable: false), - PostCode = table.Column(maxLength: 100, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Locations", x => x.ID); - }); - - migrationBuilder.CreateTable( - name: "Events", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Description = table.Column(unicode: false, maxLength: 100, nullable: false), - StartDate = table.Column(nullable: false), - End_Date = table.Column(nullable: false), - LocationID = table.Column(nullable: false), - EventType = table.Column(nullable: false), - WinningBoatId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Events", x => x.ID); - table.ForeignKey( - name: "FK_Events_Locations_LocationID", - column: x => x.LocationID, - principalTable: "Locations", - principalColumn: "ID", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Boats", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Description = table.Column(unicode: false, maxLength: 100, nullable: false), - Model = table.Column(nullable: false), - Event_DetailID = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Boats", x => x.ID); - table.ForeignKey( - name: "FK_Boats_Events_Event_DetailID", - column: x => x.Event_DetailID, - principalTable: "Events", - principalColumn: "ID", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "EventPrizes", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Note = table.Column(maxLength: 100, nullable: false), - PrizeMoney = table.Column(nullable: false), - WinningPosition = table.Column(nullable: false), - Event_DetailID = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_EventPrizes", x => x.ID); - table.ForeignKey( - name: "FK_EventPrizes_Events_Event_DetailID", - column: x => x.Event_DetailID, - principalTable: "Events", - principalColumn: "ID", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Promotions", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Description = table.Column(unicode: false, maxLength: 100, nullable: false), - PromotionalManagerName = table.Column(nullable: false), - ContactNumber = table.Column(nullable: false), - ImagePath = table.Column(nullable: true), - Event_DetailID = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Promotions", x => x.ID); - table.ForeignKey( - name: "FK_Promotions_Events_Event_DetailID", - column: x => x.Event_DetailID, - principalTable: "Events", - principalColumn: "ID", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "CrewMembers", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DOB = table.Column(nullable: false), - FirstName = table.Column(unicode: false, maxLength: 100, nullable: false), - LastName = table.Column(unicode: false, maxLength: 100, nullable: false), - Email = table.Column(nullable: false), - Phone = table.Column(nullable: true), - Username = table.Column(unicode: false, maxLength: 20, nullable: false), - Password = table.Column(unicode: false, maxLength: 10, nullable: false), - Role = table.Column(nullable: false), - BoatID = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CrewMembers", x => x.ID); - table.ForeignKey( - name: "FK_CrewMembers_Boats_BoatID", - column: x => x.BoatID, - principalTable: "Boats", - principalColumn: "ID", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "SponsorShips", - columns: table => new - { - ID = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - CompanyName = table.Column(maxLength: 100, nullable: false), - SponsorAmount = table.Column(nullable: false), - PromotionID = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_SponsorShips", x => x.ID); - table.ForeignKey( - name: "FK_SponsorShips_Promotions_PromotionID", - column: x => x.PromotionID, - principalTable: "Promotions", - principalColumn: "ID", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.InsertData( - table: "Boats", - columns: new[] { "ID", "Description", "Event_DetailID", "Model" }, - values: new object[] { 1, "Blue and shiny and very fast ayyyyeeee", null, 1 }); - - migrationBuilder.InsertData( - table: "EventPrizes", - columns: new[] { "ID", "Event_DetailID", "Note", "PrizeMoney", "WinningPosition" }, - values: new object[] { 1, null, "Event Note", 1000, 0 }); - - migrationBuilder.InsertData( - table: "Locations", - columns: new[] { "ID", "City", "Country", "PostCode" }, - values: new object[] { 1, "Coventry", "England", "cv19ll" }); - - migrationBuilder.InsertData( - table: "Promotions", - columns: new[] { "ID", "ContactNumber", "Description", "Event_DetailID", "ImagePath", "PromotionalManagerName" }, - values: new object[] { 1, "54654654", "Description", null, null, "Timmy" }); - - migrationBuilder.InsertData( - table: "SponsorShips", - columns: new[] { "ID", "CompanyName", "PromotionID", "SponsorAmount" }, - values: new object[] { 1, "Description", null, 1000 }); - - migrationBuilder.InsertData( - table: "CrewMembers", - columns: new[] { "ID", "BoatID", "DOB", "Email", "FirstName", "LastName", "Password", "Phone", "Role", "Username" }, - values: new object[] { 1, 1, new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), "AdamDavis@G.Com", "Adam", "Davis", "dadas", "14521256", 0, "Captin Davis" }); - - migrationBuilder.InsertData( - table: "CrewMembers", - columns: new[] { "ID", "BoatID", "DOB", "Email", "FirstName", "LastName", "Password", "Phone", "Role", "Username" }, - values: new object[] { 2, 1, new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), "JoBob@G.Com", "Jo", "Bob", "dadas", "14521256", 1, "Enginer Jo" }); - - migrationBuilder.InsertData( - table: "CrewMembers", - columns: new[] { "ID", "BoatID", "DOB", "Email", "FirstName", "LastName", "Password", "Phone", "Role", "Username" }, - values: new object[] { 3, 1, new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), "PhillCrack@G.Com", "Phill", "Crack", "dadas", "14521256", 3, "Recover Phill" }); - - migrationBuilder.InsertData( - table: "Events", - columns: new[] { "ID", "Description", "End_Date", "EventType", "LocationID", "StartDate", "WinningBoatId" }, - values: new object[] { 1, "SpeedBoats", new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), 0, 1, new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), 1 }); - - migrationBuilder.CreateIndex( - name: "IX_Boats_Event_DetailID", - table: "Boats", - column: "Event_DetailID"); - - migrationBuilder.CreateIndex( - name: "IX_CrewMembers_BoatID", - table: "CrewMembers", - column: "BoatID"); - - migrationBuilder.CreateIndex( - name: "IX_EventPrizes_Event_DetailID", - table: "EventPrizes", - column: "Event_DetailID"); - - migrationBuilder.CreateIndex( - name: "IX_Events_LocationID", - table: "Events", - column: "LocationID"); - - migrationBuilder.CreateIndex( - name: "IX_Promotions_Event_DetailID", - table: "Promotions", - column: "Event_DetailID"); - - migrationBuilder.CreateIndex( - name: "IX_SponsorShips_PromotionID", - table: "SponsorShips", - column: "PromotionID"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CrewMembers"); - - migrationBuilder.DropTable( - name: "EventPrizes"); - - migrationBuilder.DropTable( - name: "SponsorShips"); - - migrationBuilder.DropTable( - name: "Boats"); - - migrationBuilder.DropTable( - name: "Promotions"); - - migrationBuilder.DropTable( - name: "Events"); - - migrationBuilder.DropTable( - name: "Locations"); - } - } -} diff --git a/Code/groupH_M32COM.Angular/Migrations/RCBoatDBContextModelSnapshot.cs b/Code/groupH_M32COM.Angular/Migrations/RCBoatDBContextModelSnapshot.cs deleted file mode 100644 index d77c0f9..0000000 --- a/Code/groupH_M32COM.Angular/Migrations/RCBoatDBContextModelSnapshot.cs +++ /dev/null @@ -1,277 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using groupH_M32COM.Angular.DatabaseClasses; - -namespace groupH_M32COM.Angular.Migrations -{ - [DbContext(typeof(RCBoatDBContext))] - partial class RCBoatDBContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "2.1.8-servicing-32085"); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Boat", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Event_DetailID"); - - b.Property("Model"); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("Boats"); - - b.HasData( - new { ID = 1, Description = "Blue and shiny and very fast ayyyyeeee", Model = 1 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Crew_Member", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("BoatID"); - - b.Property("DOB"); - - b.Property("Email") - .IsRequired(); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Password") - .IsRequired() - .HasMaxLength(10) - .IsUnicode(false); - - b.Property("Phone"); - - b.Property("Role"); - - b.Property("Username") - .IsRequired() - .HasMaxLength(20) - .IsUnicode(false); - - b.HasKey("ID"); - - b.HasIndex("BoatID"); - - b.ToTable("CrewMembers"); - - b.HasData( - new { ID = 1, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "AdamDavis@G.Com", FirstName = "Adam", LastName = "Davis", Password = "dadas", Phone = "14521256", Role = 0, Username = "Captin Davis" }, - new { ID = 2, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "JoBob@G.Com", FirstName = "Jo", LastName = "Bob", Password = "dadas", Phone = "14521256", Role = 1, Username = "Enginer Jo" }, - new { ID = 3, BoatID = 1, DOB = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), Email = "PhillCrack@G.Com", FirstName = "Phill", LastName = "Crack", Password = "dadas", Phone = "14521256", Role = 3, Username = "Recover Phill" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Event_Detail", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("End_Date"); - - b.Property("EventType"); - - b.Property("LocationID"); - - b.Property("StartDate"); - - b.Property("WinningBoatId"); - - b.HasKey("ID"); - - b.HasIndex("LocationID"); - - b.ToTable("Events"); - - b.HasData( - new { ID = 1, Description = "SpeedBoats", End_Date = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), EventType = 0, LocationID = 1, StartDate = new DateTime(2019, 3, 22, 23, 41, 34, 824, DateTimeKind.Local), WinningBoatId = 1 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.EventPrizes", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("Event_DetailID"); - - b.Property("Note") - .IsRequired() - .HasMaxLength(100); - - b.Property("PrizeMoney"); - - b.Property("WinningPosition"); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("EventPrizes"); - - b.HasData( - new { ID = 1, Note = "Event Note", PrizeMoney = 1000, WinningPosition = 0 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Location", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("City") - .IsRequired() - .HasMaxLength(100); - - b.Property("Country") - .IsRequired() - .HasMaxLength(100); - - b.Property("PostCode") - .IsRequired() - .HasMaxLength(100); - - b.HasKey("ID"); - - b.ToTable("Locations"); - - b.HasData( - new { ID = 1, City = "Coventry", Country = "England", PostCode = "cv19ll" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Promotion", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("ContactNumber") - .IsRequired(); - - b.Property("Description") - .IsRequired() - .HasMaxLength(100) - .IsUnicode(false); - - b.Property("Event_DetailID"); - - b.Property("ImagePath"); - - b.Property("PromotionalManagerName") - .IsRequired(); - - b.HasKey("ID"); - - b.HasIndex("Event_DetailID"); - - b.ToTable("Promotions"); - - b.HasData( - new { ID = 1, ContactNumber = "54654654", Description = "Description", PromotionalManagerName = "Timmy" } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.SponsorShip", b => - { - b.Property("ID") - .ValueGeneratedOnAdd(); - - b.Property("CompanyName") - .IsRequired() - .HasMaxLength(100); - - b.Property("PromotionID"); - - b.Property("SponsorAmount"); - - b.HasKey("ID"); - - b.HasIndex("PromotionID"); - - b.ToTable("SponsorShips"); - - b.HasData( - new { ID = 1, CompanyName = "Description", SponsorAmount = 1000 } - ); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Boat", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("RegisterdBoats") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Crew_Member", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Boat", "Boat") - .WithMany("CrewMembers") - .HasForeignKey("BoatID") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Event_Detail", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Location", "Location") - .WithMany() - .HasForeignKey("LocationID") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.EventPrizes", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("Prizes") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.Promotion", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Event_Detail") - .WithMany("Promotions") - .HasForeignKey("Event_DetailID"); - }); - - modelBuilder.Entity("groupH_M32COM.Angular.Models.SponsorShip", b => - { - b.HasOne("groupH_M32COM.Angular.Models.Promotion") - .WithMany("Sponsorships") - .HasForeignKey("PromotionID"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Code/groupH_M32COM.Angular/Models/Boat.cs b/Code/groupH_M32COM.Angular/Models/Boat.cs index 77dea76..f6d0b1e 100644 --- a/Code/groupH_M32COM.Angular/Models/Boat.cs +++ b/Code/groupH_M32COM.Angular/Models/Boat.cs @@ -17,12 +17,15 @@ namespace groupH_M32COM.Angular.Models { public Boat() { - CrewMembers = new Collection(); + CrewMembers = new HashSet(); + Events = new HashSet(); + } public int ID { get; set; } public string Description { get; set; } - public BoatModel Model { get; set; } - public ICollection CrewMembers { get; set; } + public BoatModel Model { get; set; } public string ImagePath { get; set; } + public virtual ICollection CrewMembers { get; set; } + public virtual ICollection Events { get; set; } } } diff --git a/Code/groupH_M32COM.Angular/Models/EventDetail.cs b/Code/groupH_M32COM.Angular/Models/Event.cs similarity index 51% rename from Code/groupH_M32COM.Angular/Models/EventDetail.cs rename to Code/groupH_M32COM.Angular/Models/Event.cs index 433590d..418d1f4 100644 --- a/Code/groupH_M32COM.Angular/Models/EventDetail.cs +++ b/Code/groupH_M32COM.Angular/Models/Event.cs @@ -4,8 +4,14 @@ using System.Collections.ObjectModel; namespace groupH_M32COM.Angular.Models { - public class EventDetail + public class Event { + public Event() + { + this.Prizes = new HashSet(); + this.Promotions = new HashSet(); + this.Boats = new HashSet(); + } public int ID { get; set; } public string Description { get; set; } public DateTime StartDate { get; set; } @@ -15,17 +21,8 @@ namespace groupH_M32COM.Angular.Models public BoatModel EventType { get; set; } public Boat WinningBoat { get; set; } public int WinningBoatId { get; set; } - public ICollection Prizes { get; set; } - public ICollection Promotions { get; set; } - public ICollection RegisterdBoats { get; set; } - public ICollection Sponsors { get; set; } - - public EventDetail() - { - this.Prizes = new Collection(); - this.Promotions = new Collection(); - this.RegisterdBoats = new Collection(); - this.Sponsors = new Collection(); - } + public virtual ICollection Prizes { get; set; } + public virtual ICollection Promotions { get; set; } + public virtual ICollection Boats { get; set; } } } diff --git a/Code/groupH_M32COM.Angular/Models/EventDetailBoat.cs b/Code/groupH_M32COM.Angular/Models/EventDetailBoat.cs new file mode 100644 index 0000000..133a628 --- /dev/null +++ b/Code/groupH_M32COM.Angular/Models/EventDetailBoat.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace groupH_M32COM.Angular.Models +{ + public class EventDetailBoat + { + public Event Event { get; set; } + public int EventId{ get; set; } + public Boat Boat { get; set; } + public int BoatId { get; set; } + } +} diff --git a/Code/groupH_M32COM.Angular/Models/EventDetailPrizes.cs b/Code/groupH_M32COM.Angular/Models/EventDetailPrizes.cs new file mode 100644 index 0000000..e460bce --- /dev/null +++ b/Code/groupH_M32COM.Angular/Models/EventDetailPrizes.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace groupH_M32COM.Angular.Models +{ + + public class EventDetailPrizes + { + public Event Event { get; set; } + public int EventId { get; set; } + public EventPrize Prize { get; set; } + public int PrizeId { get; set; } + } +} diff --git a/Code/groupH_M32COM.Angular/Models/EventDetailPromotion.cs b/Code/groupH_M32COM.Angular/Models/EventDetailPromotion.cs new file mode 100644 index 0000000..cc9b3af --- /dev/null +++ b/Code/groupH_M32COM.Angular/Models/EventDetailPromotion.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace groupH_M32COM.Angular.Models +{ + public class EventDetailPromotion + { + public Event Event { get; set; } + public int EventId { get; set; } + public Promotion Promotion { get; set; } + public int PromotionId { get; set; } + } +} diff --git a/Code/groupH_M32COM.Angular/Models/EventPrizes.cs b/Code/groupH_M32COM.Angular/Models/EventPrizes.cs index fb7dfc5..3aa65d2 100644 --- a/Code/groupH_M32COM.Angular/Models/EventPrizes.cs +++ b/Code/groupH_M32COM.Angular/Models/EventPrizes.cs @@ -11,11 +11,17 @@ namespace groupH_M32COM.Angular.Models Second, Third } - public class EventPrizes + public class EventPrize { + public EventPrize() + { + this.Events = new HashSet(); + } public int ID { get; set; } public string Note { get; set; } public int PrizeMoney { get; set; } public WinningPositions WinningPosition { get; set; } + public virtual ICollection Events { get; set; } + } } diff --git a/Code/groupH_M32COM.Angular/Models/Promotion.cs b/Code/groupH_M32COM.Angular/Models/Promotion.cs index fd4c3e1..950f7b1 100644 --- a/Code/groupH_M32COM.Angular/Models/Promotion.cs +++ b/Code/groupH_M32COM.Angular/Models/Promotion.cs @@ -14,11 +14,17 @@ namespace groupH_M32COM.Angular.Models public class Promotion { + public Promotion() + { + this.Events = new HashSet(); + } public int ID { get; set; } public string Description { get; set; } public string PromotionalManagerName { get; set; } public string ContactNumber { get; set; } - public ICollection Sponsorships { get; set; } public string ImagePath { get; set; } + public SponsorShip Sponsor { get; set; } + public virtual ICollection Events { get; set; } + } } diff --git a/Code/groupH_M32COM.Angular/Startup.cs b/Code/groupH_M32COM.Angular/Startup.cs index e973ab0..52323f6 100644 --- a/Code/groupH_M32COM.Angular/Startup.cs +++ b/Code/groupH_M32COM.Angular/Startup.cs @@ -43,7 +43,7 @@ namespace groupH_M32COM.Angular options.UseSqlServer(Configuration.GetConnectionString("MyDbConnection"))); else services.AddDbContext(options => - options.UseSqlite("Data Source=localdatabase.db")); + options.UseSqlite("Data Source=localdatabase.db").EnableSensitiveDataLogging()); // Automatically perform database migration services.BuildServiceProvider().GetService().Database.Migrate(); diff --git a/Code/groupH_M32COM.Angular/localdatabase.db b/Code/groupH_M32COM.Angular/localdatabase.db index a652460a6965437f5b7fd23a5b95f835dc689e47..185eae8eaaec0b8701a635bc10c16f870732c027 100644 GIT binary patch literal 106496 zcmeI5&u<&Y6~|{uSriq?>mRY#a_V|T*R2WJmi2?N9U(|)a%C`Ll)@`vTx zNMh!@(u%Y5X5P&E%$wPnS&=MVUaB<>^#!X@*PH4b*+V3WJgcgNkhkc0n4UxQJVc1J z;D+f7KO`^E=k+ae`UkI%(*%tgF@;29E?u#i46H@Cy&8!+P=TpXw+UYY$tWrXzI1~T$X2b1ahXRrOTR{%V)J! zHNo`O<(P7o>KXU+WE#dx%SQd0(XcBQEWMe_3NgDo6bM2$c|u*us|g`Kp`J)Mni9zu zcgK|TiqzWc6~_dj3iGJ(j*_~hbc*5vRtUG$Gdq!dV`)6596v6-`FvBqwr=?BY8$o~ z9&<}d?;TdIOiP5<%)Yr!{h^|7HZ6WFB6T6p2*o*3d$zAp^QNYx+pqExg#@gQp-a!g za{9uOriztkiK#u~qbfZTxom! z@zLbd^00DwY6pJ8EUSoK!XkEWXQ)?BPD-~ga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Wj+1=Q2NQyer zo85i$-kWc}_ulN>Iy?6X^L~@>07X$gB9+mz)Sj30*cPVFcGdH``w48qN3fq57^6(pakxJUK!u;kGjD<8Uej<+cij z>av0oWY?PhHLAB#50$6@{6erN%&=3x)$ z&Gpb0v3oguA_C=(3MSJls}$dsDxf};0WbZIG?8Tpu$qMmT5Izf$Gvu6;N2XKM&Zhs zz9K*Xoce|U>wFcm?iS!sq?W+#tn5gT-sy)%NNR|0*FP4(DZJ}(aX1ozs}uTy1J3GR zC$K`lB3&Morp`->9&$npogD7d@(4Qyii%nq%1`O{SZLrf`Ra$CnIhB^n}&lI8|KNh3 zwA(g^eiy@z(1*0!E_-ur@}G5=j`U=SAS^&3vWz-SwuZ?)@aZ0WJgPkA_e97DNYy9jmdRf0`4u3c?g12U(54$ZSw z2XZrv+d16b4fDe$m|QM3Fj#y|$s0G4`btqP$;w-MDs4MC+|!0M<5mGzW2OsXkumC9 zkMZEoKE*9Nk{;|GIb&35r3FY07A{ScUX>J;K&$k~u+=AouQbczv)x*ZY3SZFXfC#= znl|ooK({D#Yt`pnN1-mDQ{C~-*o&Qscs!oyiX~pijm;GDC8_UHak3yO+QVQIbC*JQ zSAFMxM$ZN56#swbR{Z-Ex=-xyAg&SYRG`VPJ)HILVo2)3lR1j&VoeFb0#G-9fe1<)e|bjoA6>B7qR*pJq3|+!{Fr#I7Dc zABbYd)9f~uj}eT2p|7&=59*_M!A$ED3OzCZ;l_X5yCufEXG;t-M8rYF(DOuGM4aR# W-yoW%skP0QU^58hIZU25ivJg@dRt)t diff --git a/DROPDBSTUFF.sql b/DROPDBSTUFF.sql new file mode 100644 index 0000000..c99ae50 --- /dev/null +++ b/DROPDBSTUFF.sql @@ -0,0 +1,9 @@ +-- Script Date: 23/03/2019 12:33 - ErikEJ.SqlCeScripting version 3.5.2.80 +DROP TABLE [__EFMigrationsHistory]; +DROP TABLE [Boats]; +DROP TABLE [CrewMembers]; +DROP TABLE [EventPrizes]; +DROP TABLE [Events]; +DROP TABLE [Promotions]; +DROP TABLE [Sponsorships]; +DROP TABLE [Locations];