Advertisement
Guest User

20150929181902_Init.cs

a guest
Sep 29th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 8.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using Microsoft.Data.Entity.Migrations;
  4. using Microsoft.Data.Entity.SqlServer.Metadata;
  5.  
  6. namespace WebApplication2.Migrations
  7. {
  8.     public partial class Init : Migration
  9.     {
  10.         protected override void Up(MigrationBuilder migrationBuilder)
  11.         {
  12.             migrationBuilder.CreateTable(
  13.                 name: "AspNetRoles",
  14.                 columns: table => new
  15.                 {
  16.                     Id = table.Column<string>(isNullable: false),
  17.                     ConcurrencyStamp = table.Column<string>(isNullable: true),
  18.                     Name = table.Column<string>(isNullable: true),
  19.                     NormalizedName = table.Column<string>(isNullable: true)
  20.                 },
  21.                 constraints: table =>
  22.                 {
  23.                     table.PrimaryKey("PK_IdentityRole", x => x.Id);
  24.                 });
  25.             migrationBuilder.CreateTable(
  26.                 name: "AspNetUsers",
  27.                 columns: table => new
  28.                 {
  29.                     Id = table.Column<string>(isNullable: false),
  30.                     AccessFailedCount = table.Column<int>(isNullable: false),
  31.                     ConcurrencyStamp = table.Column<string>(isNullable: true),
  32.                     Email = table.Column<string>(isNullable: true),
  33.                     EmailConfirmed = table.Column<bool>(isNullable: false),
  34.                     LockoutEnabled = table.Column<bool>(isNullable: false),
  35.                     LockoutEnd = table.Column<DateTimeOffset>(isNullable: true),
  36.                     NormalizedEmail = table.Column<string>(isNullable: true),
  37.                     NormalizedUserName = table.Column<string>(isNullable: true),
  38.                     PasswordHash = table.Column<string>(isNullable: true),
  39.                     PhoneNumber = table.Column<string>(isNullable: true),
  40.                     PhoneNumberConfirmed = table.Column<bool>(isNullable: false),
  41.                     SecurityStamp = table.Column<string>(isNullable: true),
  42.                     TwoFactorEnabled = table.Column<bool>(isNullable: false),
  43.                     UserName = table.Column<string>(isNullable: true)
  44.                 },
  45.                 constraints: table =>
  46.                 {
  47.                     table.PrimaryKey("PK_ApplicationUser", x => x.Id);
  48.                 });
  49.             migrationBuilder.CreateTable(
  50.                 name: "AspNetRoleClaims",
  51.                 columns: table => new
  52.                 {
  53.                     Id = table.Column<int>(isNullable: false)
  54.                         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn),
  55.                     ClaimType = table.Column<string>(isNullable: true),
  56.                     ClaimValue = table.Column<string>(isNullable: true),
  57.                     RoleId = table.Column<string>(isNullable: true)
  58.                 },
  59.                 constraints: table =>
  60.                 {
  61.                     table.PrimaryKey("PK_IdentityRoleClaim<string>", x => x.Id);
  62.                     table.ForeignKey(
  63.                         name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
  64.                         column: x => x.RoleId,
  65.                         principalTable: "AspNetRoles",
  66.                         principalColumn: "Id");
  67.                 });
  68.             migrationBuilder.CreateTable(
  69.                 name: "AspNetUserClaims",
  70.                 columns: table => new
  71.                 {
  72.                     Id = table.Column<int>(isNullable: false)
  73.                         .Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn),
  74.                     ClaimType = table.Column<string>(isNullable: true),
  75.                     ClaimValue = table.Column<string>(isNullable: true),
  76.                     UserId = table.Column<string>(isNullable: true)
  77.                 },
  78.                 constraints: table =>
  79.                 {
  80.                     table.PrimaryKey("PK_IdentityUserClaim<string>", x => x.Id);
  81.                     table.ForeignKey(
  82.                         name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
  83.                         column: x => x.UserId,
  84.                         principalTable: "AspNetUsers",
  85.                         principalColumn: "Id");
  86.                 });
  87.             migrationBuilder.CreateTable(
  88.                 name: "AspNetUserLogins",
  89.                 columns: table => new
  90.                 {
  91.                     LoginProvider = table.Column<string>(isNullable: false),
  92.                     ProviderKey = table.Column<string>(isNullable: false),
  93.                     ProviderDisplayName = table.Column<string>(isNullable: true),
  94.                     UserId = table.Column<string>(isNullable: true)
  95.                 },
  96.                 constraints: table =>
  97.                 {
  98.                     table.PrimaryKey("PK_IdentityUserLogin<string>", x => new { x.LoginProvider, x.ProviderKey });
  99.                     table.ForeignKey(
  100.                         name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
  101.                         column: x => x.UserId,
  102.                         principalTable: "AspNetUsers",
  103.                         principalColumn: "Id");
  104.                 });
  105.             migrationBuilder.CreateTable(
  106.                 name: "AspNetUserRoles",
  107.                 columns: table => new
  108.                 {
  109.                     UserId = table.Column<string>(isNullable: false),
  110.                     RoleId = table.Column<string>(isNullable: false)
  111.                 },
  112.                 constraints: table =>
  113.                 {
  114.                     table.PrimaryKey("PK_IdentityUserRole<string>", x => new { x.UserId, x.RoleId });
  115.                     table.ForeignKey(
  116.                         name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
  117.                         column: x => x.RoleId,
  118.                         principalTable: "AspNetRoles",
  119.                         principalColumn: "Id");
  120.                     table.ForeignKey(
  121.                         name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
  122.                         column: x => x.UserId,
  123.                         principalTable: "AspNetUsers",
  124.                         principalColumn: "Id");
  125.                 });
  126.             migrationBuilder.CreateTable(
  127.                 name: "Building",
  128.                 columns: table => new
  129.                 {
  130.                     Id = table.Column<Guid>(isNullable: false),
  131.                     Address = table.Column<string>(isNullable: true),
  132.                     ApplicationUserId = table.Column<Guid>(isNullable: false),
  133.                     ApplicationUserId1 = table.Column<string>(isNullable: true)
  134.                 },
  135.                 constraints: table =>
  136.                 {
  137.                     table.PrimaryKey("PK_Building", x => x.Id);
  138.                     table.ForeignKey(
  139.                         name: "FK_Building_ApplicationUser_ApplicationUserId1",
  140.                         column: x => x.ApplicationUserId1,
  141.                         principalTable: "AspNetUsers",
  142.                         principalColumn: "Id");
  143.                 });
  144.             migrationBuilder.CreateTable(
  145.                 name: "City",
  146.                 columns: table => new
  147.                 {
  148.                     Id = table.Column<Guid>(isNullable: false),
  149.                     ApplicationUserId = table.Column<Guid>(isNullable: false),
  150.                     ApplicationUserId1 = table.Column<string>(isNullable: true),
  151.                     Name = table.Column<string>(isNullable: true)
  152.                 },
  153.                 constraints: table =>
  154.                 {
  155.                     table.PrimaryKey("PK_City", x => x.Id);
  156.                     table.ForeignKey(
  157.                         name: "FK_City_ApplicationUser_ApplicationUserId1",
  158.                         column: x => x.ApplicationUserId1,
  159.                         principalTable: "AspNetUsers",
  160.                         principalColumn: "Id");
  161.                 });
  162.             migrationBuilder.CreateIndex(
  163.                 name: "RoleNameIndex",
  164.                 table: "AspNetRoles",
  165.                 column: "NormalizedName");
  166.             migrationBuilder.CreateIndex(
  167.                 name: "EmailIndex",
  168.                 table: "AspNetUsers",
  169.                 column: "NormalizedEmail");
  170.             migrationBuilder.CreateIndex(
  171.                 name: "UserNameIndex",
  172.                 table: "AspNetUsers",
  173.                 column: "NormalizedUserName");
  174.         }
  175.  
  176.         protected override void Down(MigrationBuilder migrationBuilder)
  177.         {
  178.             migrationBuilder.DropTable("AspNetRoleClaims");
  179.             migrationBuilder.DropTable("AspNetUserClaims");
  180.             migrationBuilder.DropTable("AspNetUserLogins");
  181.             migrationBuilder.DropTable("AspNetUserRoles");
  182.             migrationBuilder.DropTable("Building");
  183.             migrationBuilder.DropTable("City");
  184.             migrationBuilder.DropTable("AspNetRoles");
  185.             migrationBuilder.DropTable("AspNetUsers");
  186.         }
  187.     }
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement