Advertisement
Venciity

ASP.NET Core Migrations

May 19th, 2016
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.Data.Entity.Migrations;
  4. using Microsoft.Data.Entity.Metadata;
  5.  
  6. namespace OdeToFood.Migrations
  7. {
  8.     public partial class v1 : Migration
  9.     {
  10.         protected override void Up(MigrationBuilder migrationBuilder)
  11.         {
  12.             migrationBuilder.CreateTable(
  13.                 name: "Restaurant",
  14.                 columns: table => new
  15.                 {
  16.                     Id = table.Column<int>(nullable: false)
  17.                         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  18.                     Cuisine = table.Column<int>(nullable: false),
  19.                     Name = table.Column<string>(nullable: false)
  20.                 },
  21.                 constraints: table =>
  22.                 {
  23.                     table.PrimaryKey("PK_Restaurant", x => x.Id);
  24.                 });
  25.         }
  26.  
  27.         protected override void Down(MigrationBuilder migrationBuilder)
  28.         {
  29.             migrationBuilder.DropTable("Restaurant");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement