From 287e6525b2560056b1df747185f263831dda0e08 Mon Sep 17 00:00:00 2001 From: gorohoroh Date: Fri, 6 Jul 2018 18:04:11 +0300 Subject: [PATCH] Executing EF Core migrations --- .../20180706131502_InitialCreate.Designer.cs | 43 +++++++++++++++++++ .../20180706131502_InitialCreate.cs | 33 ++++++++++++++ .../OdeToFoodDbContextModelSnapshot.cs | 42 ++++++++++++++++++ .../20180706130949_InitialCreate.Designer.cs | 43 +++++++++++++++++++ .../20180706130949_InitialCreate.cs | 33 ++++++++++++++ .../OdeToFoodDbContextModelSnapshot.cs | 42 ++++++++++++++++++ 6 files changed, 236 insertions(+) create mode 100644 OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.Designer.cs create mode 100644 OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.cs create mode 100644 OdeToFoodRider/OdeToFoodRider/Migrations/OdeToFoodDbContextModelSnapshot.cs create mode 100644 OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.Designer.cs create mode 100644 OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.cs create mode 100644 OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/OdeToFoodDbContextModelSnapshot.cs diff --git a/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.Designer.cs b/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.Designer.cs new file mode 100644 index 0000000..b4489d8 --- /dev/null +++ b/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.Designer.cs @@ -0,0 +1,43 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using OdeToFoodRider.Data; +using OdeToFoodRider.Models; +using System; + +namespace OdeToFoodRider.Migrations +{ + [DbContext(typeof(OdeToFoodDbContext))] + [Migration("20180706131502_InitialCreate")] + partial class InitialCreate + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.3-rtm-10026") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("OdeToFoodRider.Models.Restaurant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cuisine"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80); + + b.HasKey("Id"); + + b.ToTable("Restaurants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.cs b/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.cs new file mode 100644 index 0000000..86c8971 --- /dev/null +++ b/OdeToFoodRider/OdeToFoodRider/Migrations/20180706131502_InitialCreate.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace OdeToFoodRider.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Restaurants", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Cuisine = table.Column(nullable: false), + Name = table.Column(maxLength: 80, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Restaurants", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Restaurants"); + } + } +} diff --git a/OdeToFoodRider/OdeToFoodRider/Migrations/OdeToFoodDbContextModelSnapshot.cs b/OdeToFoodRider/OdeToFoodRider/Migrations/OdeToFoodDbContextModelSnapshot.cs new file mode 100644 index 0000000..4587c11 --- /dev/null +++ b/OdeToFoodRider/OdeToFoodRider/Migrations/OdeToFoodDbContextModelSnapshot.cs @@ -0,0 +1,42 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using OdeToFoodRider.Data; +using OdeToFoodRider.Models; +using System; + +namespace OdeToFoodRider.Migrations +{ + [DbContext(typeof(OdeToFoodDbContext))] + partial class OdeToFoodDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.3-rtm-10026") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("OdeToFoodRider.Models.Restaurant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cuisine"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80); + + b.HasKey("Id"); + + b.ToTable("Restaurants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.Designer.cs b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.Designer.cs new file mode 100644 index 0000000..0031d47 --- /dev/null +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.Designer.cs @@ -0,0 +1,43 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using OdeToFoodVisualStudio.Data; +using OdeToFoodVisualStudio.Models; +using System; + +namespace OdeToFoodVisualStudio.Migrations +{ + [DbContext(typeof(OdeToFoodDbContext))] + [Migration("20180706130949_InitialCreate")] + partial class InitialCreate + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.3-rtm-10026") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("OdeToFoodVisualStudio.Models.Restaurant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cuisine"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80); + + b.HasKey("Id"); + + b.ToTable("Restaurants"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.cs b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.cs new file mode 100644 index 0000000..a23f90e --- /dev/null +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/20180706130949_InitialCreate.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace OdeToFoodVisualStudio.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Restaurants", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Cuisine = table.Column(nullable: false), + Name = table.Column(maxLength: 80, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Restaurants", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Restaurants"); + } + } +} diff --git a/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/OdeToFoodDbContextModelSnapshot.cs b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/OdeToFoodDbContextModelSnapshot.cs new file mode 100644 index 0000000..549684e --- /dev/null +++ b/OdeToFoodVisualStudio/OdeToFoodVisualStudio/Migrations/OdeToFoodDbContextModelSnapshot.cs @@ -0,0 +1,42 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage; +using Microsoft.EntityFrameworkCore.Storage.Internal; +using OdeToFoodVisualStudio.Data; +using OdeToFoodVisualStudio.Models; +using System; + +namespace OdeToFoodVisualStudio.Migrations +{ + [DbContext(typeof(OdeToFoodDbContext))] + partial class OdeToFoodDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.0.3-rtm-10026") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("OdeToFoodVisualStudio.Models.Restaurant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Cuisine"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(80); + + b.HasKey("Id"); + + b.ToTable("Restaurants"); + }); +#pragma warning restore 612, 618 + } + } +}