using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DamageAssesment.Api.UsersAccess.Migrations
{
///
public partial class AzureUserAccess : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Roles",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
Description = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Roles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Tokens",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
UserId = table.Column(type: "int", nullable: false),
RefreshToken = table.Column(type: "nvarchar(max)", nullable: true),
IsActive = table.Column(type: "bit", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Tokens", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
EmployeeId = table.Column(type: "int", nullable: false),
EmployeeCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false),
RoleId = table.Column(type: "int", nullable: false),
IsActive = table.Column(type: "bit", nullable: false),
CreateDate = table.Column(type: "datetime2", nullable: false),
UpdateDate = table.Column(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Roles");
migrationBuilder.DropTable(
name: "Tokens");
migrationBuilder.DropTable(
name: "Users");
}
}
}