Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using Microsoft.Data.Entity.Migrations;
- using Microsoft.Data.Entity.SqlServer.Metadata;
- namespace WebApplication2.Migrations
- {
- public partial class Init : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "AspNetRoles",
- columns: table => new
- {
- Id = table.Column<string>(isNullable: false),
- ConcurrencyStamp = table.Column<string>(isNullable: true),
- Name = table.Column<string>(isNullable: true),
- NormalizedName = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityRole", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "AspNetUsers",
- columns: table => new
- {
- Id = table.Column<string>(isNullable: false),
- AccessFailedCount = table.Column<int>(isNullable: false),
- ConcurrencyStamp = table.Column<string>(isNullable: true),
- Email = table.Column<string>(isNullable: true),
- EmailConfirmed = table.Column<bool>(isNullable: false),
- LockoutEnabled = table.Column<bool>(isNullable: false),
- LockoutEnd = table.Column<DateTimeOffset>(isNullable: true),
- NormalizedEmail = table.Column<string>(isNullable: true),
- NormalizedUserName = table.Column<string>(isNullable: true),
- PasswordHash = table.Column<string>(isNullable: true),
- PhoneNumber = table.Column<string>(isNullable: true),
- PhoneNumberConfirmed = table.Column<bool>(isNullable: false),
- SecurityStamp = table.Column<string>(isNullable: true),
- TwoFactorEnabled = table.Column<bool>(isNullable: false),
- UserName = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ApplicationUser", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "AspNetRoleClaims",
- columns: table => new
- {
- Id = table.Column<int>(isNullable: false)
- .Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn),
- ClaimType = table.Column<string>(isNullable: true),
- ClaimValue = table.Column<string>(isNullable: true),
- RoleId = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityRoleClaim<string>", x => x.Id);
- table.ForeignKey(
- name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id");
- });
- migrationBuilder.CreateTable(
- name: "AspNetUserClaims",
- columns: table => new
- {
- Id = table.Column<int>(isNullable: false)
- .Annotation("SqlServer:ValueGenerationStrategy", SqlServerIdentityStrategy.IdentityColumn),
- ClaimType = table.Column<string>(isNullable: true),
- ClaimValue = table.Column<string>(isNullable: true),
- UserId = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityUserClaim<string>", x => x.Id);
- table.ForeignKey(
- name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- });
- migrationBuilder.CreateTable(
- name: "AspNetUserLogins",
- columns: table => new
- {
- LoginProvider = table.Column<string>(isNullable: false),
- ProviderKey = table.Column<string>(isNullable: false),
- ProviderDisplayName = table.Column<string>(isNullable: true),
- UserId = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityUserLogin<string>", x => new { x.LoginProvider, x.ProviderKey });
- table.ForeignKey(
- name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- });
- migrationBuilder.CreateTable(
- name: "AspNetUserRoles",
- columns: table => new
- {
- UserId = table.Column<string>(isNullable: false),
- RoleId = table.Column<string>(isNullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_IdentityUserRole<string>", x => new { x.UserId, x.RoleId });
- table.ForeignKey(
- name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
- column: x => x.RoleId,
- principalTable: "AspNetRoles",
- principalColumn: "Id");
- table.ForeignKey(
- name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
- column: x => x.UserId,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- });
- migrationBuilder.CreateTable(
- name: "Building",
- columns: table => new
- {
- Id = table.Column<Guid>(isNullable: false),
- Address = table.Column<string>(isNullable: true),
- ApplicationUserId = table.Column<Guid>(isNullable: false),
- ApplicationUserId1 = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Building", x => x.Id);
- table.ForeignKey(
- name: "FK_Building_ApplicationUser_ApplicationUserId1",
- column: x => x.ApplicationUserId1,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- });
- migrationBuilder.CreateTable(
- name: "City",
- columns: table => new
- {
- Id = table.Column<Guid>(isNullable: false),
- ApplicationUserId = table.Column<Guid>(isNullable: false),
- ApplicationUserId1 = table.Column<string>(isNullable: true),
- Name = table.Column<string>(isNullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_City", x => x.Id);
- table.ForeignKey(
- name: "FK_City_ApplicationUser_ApplicationUserId1",
- column: x => x.ApplicationUserId1,
- principalTable: "AspNetUsers",
- principalColumn: "Id");
- });
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "AspNetRoles",
- column: "NormalizedName");
- migrationBuilder.CreateIndex(
- name: "EmailIndex",
- table: "AspNetUsers",
- column: "NormalizedEmail");
- migrationBuilder.CreateIndex(
- name: "UserNameIndex",
- table: "AspNetUsers",
- column: "NormalizedUserName");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable("AspNetRoleClaims");
- migrationBuilder.DropTable("AspNetUserClaims");
- migrationBuilder.DropTable("AspNetUserLogins");
- migrationBuilder.DropTable("AspNetUserRoles");
- migrationBuilder.DropTable("Building");
- migrationBuilder.DropTable("City");
- migrationBuilder.DropTable("AspNetRoles");
- migrationBuilder.DropTable("AspNetUsers");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement