using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWorkHR.Infrastructure.Migrations
{
///
public partial class attendance : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "IsDeleted",
table: "Companies",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit")
.Annotation("Relational:ColumnOrder", 7);
migrationBuilder.AddColumn(
name: "DeleteUserId",
table: "Companies",
type: "nvarchar(450)",
maxLength: 450,
nullable: true)
.Annotation("Relational:ColumnOrder", 8);
migrationBuilder.CreateTable(
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Method = table.Column(type: "nvarchar(max)", nullable: false),
QueryString = table.Column(type: "nvarchar(max)", nullable: true),
Input = table.Column(type: "nvarchar(max)", nullable: true),
CreateDate = table.Column(type: "datetime2", nullable: false),
CreateUser = table.Column(type: "nvarchar(max)", nullable: false),
ServerIP = table.Column(type: "nvarchar(max)", nullable: true),
Channel = table.Column(type: "nvarchar(max)", nullable: true),
UserIP = table.Column(type: "nvarchar(max)", nullable: true),
ServiceResponseTimeInSeconds = table.Column(type: "nvarchar(max)", nullable: false),
ErrorCode = table.Column(type: "nvarchar(max)", nullable: false),
ErrorDescription = table.Column(type: "nvarchar(max)", nullable: false),
InnerException = table.Column(type: "nvarchar(max)", nullable: true),
userAgent = table.Column(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Attendances",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
CreateUser = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
UpdateUser = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
CreateDate = table.Column(type: "datetime2", nullable: false),
UpdateDate = table.Column(type: "datetime2", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false),
DeleteUserId = table.Column(type: "nvarchar(450)", maxLength: 450, nullable: true),
UserId = table.Column(type: "nvarchar(max)", nullable: false),
UserName = table.Column(type: "nvarchar(max)", nullable: true),
CheckInTime = table.Column(type: "datetime2", nullable: true),
CheckOutTime = table.Column(type: "datetime2", nullable: true),
AttendanceDate = table.Column(type: "datetime2", nullable: false),
LeaveType = table.Column(type: "int", nullable: false),
LeaveReason = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Attendances", x => x.Id);
});
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendances");
migrationBuilder.DropColumn(
name: "DeleteUserId",
table: "Companies");
migrationBuilder.AlterColumn(
name: "IsDeleted",
table: "Companies",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit")
.OldAnnotation("Relational:ColumnOrder", 7);
}
}
}