using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MTWorkHR.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class altrContractDura : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "JobTitleId",
                table: "Contracts");

            migrationBuilder.AddColumn<string>(
                name: "JobTitleName",
                table: "Contracts",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "WorkingHoursNum",
                table: "Contracts",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<decimal>(
                name: "EntitlementPercent",
                table: "ContractAllowance",
                type: "decimal(18,2)",
                nullable: false,
                oldClrType: typeof(long),
                oldType: "bigint");

            migrationBuilder.AlterColumn<decimal>(
                name: "EntitlementAmount",
                table: "ContractAllowance",
                type: "decimal(18,2)",
                nullable: false,
                oldClrType: typeof(long),
                oldType: "bigint");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "JobTitleName",
                table: "Contracts");

            migrationBuilder.DropColumn(
                name: "WorkingHoursNum",
                table: "Contracts");

            migrationBuilder.AddColumn<int>(
                name: "JobTitleId",
                table: "Contracts",
                type: "int",
                nullable: true);

            migrationBuilder.AlterColumn<long>(
                name: "EntitlementPercent",
                table: "ContractAllowance",
                type: "bigint",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)");

            migrationBuilder.AlterColumn<long>(
                name: "EntitlementAmount",
                table: "ContractAllowance",
                type: "bigint",
                nullable: false,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)");
        }
    }
}
