123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace MTWorkHR.Infrastructure.Migrations
- {
- /// <inheritdoc />
- public partial class altrContractWorkingDay : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "WorkingDays",
- table: "Contracts");
- migrationBuilder.AlterColumn<int>(
- name: "WorkingHoursNum",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "WorkingHours",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "WorkStateId",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "WorkCountryId",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "WhoCanTerminateContractInTrial",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "WhoCanTerminateContract",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "VacationDays",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "NoticePeriodBeforeTermination",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "ContractorTaxResidencyId",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<int>(
- name: "ContractDurationId",
- table: "Contracts",
- type: "int",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.AlterColumn<string>(
- name: "BillingCycle",
- table: "Contracts",
- type: "nvarchar(max)",
- nullable: true,
- oldClrType: typeof(int),
- oldType: "int");
- migrationBuilder.CreateTable(
- name: "ContractWorkingDay",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- CreateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
- UpdateUser = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
- CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
- UpdateDate = table.Column<DateTime>(type: "datetime2", nullable: true),
- ContractId = table.Column<long>(type: "bigint", nullable: false),
- WorkingDay = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ContractWorkingDay", x => x.Id);
- table.ForeignKey(
- name: "FK_ContractWorkingDay_Contracts_ContractId",
- column: x => x.ContractId,
- principalTable: "Contracts",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateIndex(
- name: "IX_ContractWorkingDay_ContractId",
- table: "ContractWorkingDay",
- column: "ContractId");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "ContractWorkingDay");
- migrationBuilder.AlterColumn<int>(
- name: "WorkingHoursNum",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "WorkingHours",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "WorkStateId",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "WorkCountryId",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "WhoCanTerminateContractInTrial",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "WhoCanTerminateContract",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "VacationDays",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "NoticePeriodBeforeTermination",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "ContractorTaxResidencyId",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "ContractDurationId",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(int),
- oldType: "int",
- oldNullable: true);
- migrationBuilder.AlterColumn<int>(
- name: "BillingCycle",
- table: "Contracts",
- type: "int",
- nullable: false,
- defaultValue: 0,
- oldClrType: typeof(string),
- oldType: "nvarchar(max)",
- oldNullable: true);
- migrationBuilder.AddColumn<string>(
- name: "WorkingDays",
- table: "Contracts",
- type: "nvarchar(max)",
- nullable: false,
- defaultValue: "");
- }
- }
- }
|