123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace MTWorkHR.Infrastructure.Migrations
- {
- /// <inheritdoc />
- public partial class altrOrder : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "DateActioned",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "DateRequested",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "IsApproved",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "IsCancelled",
- table: "OrderRequests");
- migrationBuilder.AlterColumn<DateTime>(
- name: "EndDate",
- table: "OrderRequests",
- type: "datetime2",
- nullable: true,
- oldClrType: typeof(DateTime),
- oldType: "datetime2");
- migrationBuilder.AddColumn<int>(
- name: "CityId",
- table: "OrderRequests",
- type: "int",
- nullable: true);
- migrationBuilder.AddColumn<int>(
- name: "CountryId",
- table: "OrderRequests",
- type: "int",
- nullable: true);
- migrationBuilder.AddColumn<long>(
- name: "LeaveTypeId",
- table: "OrderRequests",
- type: "bigint",
- nullable: true);
- migrationBuilder.AddColumn<int>(
- name: "OrderStatus",
- table: "OrderRequests",
- type: "int",
- nullable: true);
- migrationBuilder.CreateTable(
- name: "LeaveTypes",
- 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),
- NameAr = table.Column<string>(type: "nvarchar(max)", nullable: false),
- NameEn = table.Column<string>(type: "nvarchar(max)", nullable: false),
- DefaultDays = table.Column<int>(type: "int", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LeaveTypes", x => x.Id);
- });
- migrationBuilder.CreateIndex(
- name: "IX_OrderRequests_LeaveTypeId",
- table: "OrderRequests",
- column: "LeaveTypeId");
- migrationBuilder.AddForeignKey(
- name: "FK_OrderRequests_LeaveTypes_LeaveTypeId",
- table: "OrderRequests",
- column: "LeaveTypeId",
- principalTable: "LeaveTypes",
- principalColumn: "Id");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropForeignKey(
- name: "FK_OrderRequests_LeaveTypes_LeaveTypeId",
- table: "OrderRequests");
- migrationBuilder.DropTable(
- name: "LeaveTypes");
- migrationBuilder.DropIndex(
- name: "IX_OrderRequests_LeaveTypeId",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "CityId",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "CountryId",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "LeaveTypeId",
- table: "OrderRequests");
- migrationBuilder.DropColumn(
- name: "OrderStatus",
- table: "OrderRequests");
- migrationBuilder.AlterColumn<DateTime>(
- name: "EndDate",
- table: "OrderRequests",
- type: "datetime2",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
- oldClrType: typeof(DateTime),
- oldType: "datetime2",
- oldNullable: true);
- migrationBuilder.AddColumn<DateTime>(
- name: "DateActioned",
- table: "OrderRequests",
- type: "datetime2",
- nullable: true);
- migrationBuilder.AddColumn<DateTime>(
- name: "DateRequested",
- table: "OrderRequests",
- type: "datetime2",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
- migrationBuilder.AddColumn<bool>(
- name: "IsApproved",
- table: "OrderRequests",
- type: "bit",
- nullable: true);
- migrationBuilder.AddColumn<bool>(
- name: "IsCancelled",
- table: "OrderRequests",
- type: "bit",
- nullable: false,
- defaultValue: false);
- }
- }
- }
|