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