123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace MTWorkHR.Infrastructure.Migrations
- {
- /// <inheritdoc />
- public partial class addTeamMeeting : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AlterColumn<string>(
- name: "Comment",
- table: "UserTaskHistories",
- type: "nvarchar(500)",
- maxLength: 500,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "nvarchar(500)",
- oldMaxLength: 500);
- migrationBuilder.AlterColumn<string>(
- name: "FileName",
- table: "UserTaskAttachments",
- type: "nvarchar(250)",
- maxLength: 250,
- nullable: true,
- oldClrType: typeof(string),
- oldType: "nvarchar(250)",
- oldMaxLength: 250);
- migrationBuilder.AddColumn<DateTime>(
- name: "CreateDate",
- table: "Projects",
- type: "datetime2",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified))
- .Annotation("Relational:ColumnOrder", 3);
- migrationBuilder.AddColumn<string>(
- name: "CreateUser",
- table: "Projects",
- type: "nvarchar(450)",
- maxLength: 450,
- nullable: true)
- .Annotation("Relational:ColumnOrder", 1);
- migrationBuilder.AddColumn<string>(
- name: "DeleteUserId",
- table: "Projects",
- type: "nvarchar(450)",
- maxLength: 450,
- nullable: true)
- .Annotation("Relational:ColumnOrder", 8);
- migrationBuilder.AddColumn<bool>(
- name: "IsDeleted",
- table: "Projects",
- type: "bit",
- nullable: false,
- defaultValue: false)
- .Annotation("Relational:ColumnOrder", 7);
- migrationBuilder.AddColumn<DateTime>(
- name: "UpdateDate",
- table: "Projects",
- type: "datetime2",
- nullable: true)
- .Annotation("Relational:ColumnOrder", 4);
- migrationBuilder.AddColumn<string>(
- name: "UpdateUser",
- table: "Projects",
- type: "nvarchar(450)",
- maxLength: 450,
- nullable: true)
- .Annotation("Relational:ColumnOrder", 2);
- migrationBuilder.CreateTable(
- name: "Meetings",
- 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),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false),
- DeleteUserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
- Title = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- Description = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
- MeetingDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
- MeetingLink = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Meetings", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "Teams",
- 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),
- IsDeleted = table.Column<bool>(type: "bit", nullable: false),
- DeleteUserId = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
- NameAr = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false),
- NameEn = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Teams", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "UserTaskLogs",
- columns: table => new
- {
- Id = table.Column<long>(type: "bigint", nullable: false)
- .Annotation("SqlServer:Identity", "1, 1"),
- Method = table.Column<string>(type: "nvarchar(max)", nullable: false),
- QueryString = table.Column<string>(type: "nvarchar(max)", nullable: true),
- Input = table.Column<string>(type: "nvarchar(max)", nullable: true),
- CreateDate = table.Column<DateTime>(type: "datetime2", nullable: false),
- CreateUser = table.Column<string>(type: "nvarchar(max)", nullable: false),
- ServerIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
- Channel = table.Column<string>(type: "nvarchar(max)", nullable: true),
- UserIP = table.Column<string>(type: "nvarchar(max)", nullable: true),
- ServiceResponseTimeInSeconds = table.Column<string>(type: "nvarchar(max)", nullable: false),
- ErrorCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
- ErrorDescription = table.Column<string>(type: "nvarchar(max)", nullable: false),
- InnerException = table.Column<string>(type: "nvarchar(max)", nullable: true),
- userAgent = table.Column<string>(type: "nvarchar(max)", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserTaskLogs", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "MeetingUser",
- 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),
- MeetingId = table.Column<long>(type: "bigint", nullable: false),
- AssignedUserId = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_MeetingUser", x => x.Id);
- table.ForeignKey(
- name: "FK_MeetingUser_Meetings_MeetingId",
- column: x => x.MeetingId,
- principalTable: "Meetings",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateTable(
- name: "TeamUser",
- 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),
- TeamId = table.Column<long>(type: "bigint", nullable: false),
- AssignedUserId = table.Column<string>(type: "nvarchar(max)", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_TeamUser", x => x.Id);
- table.ForeignKey(
- name: "FK_TeamUser_Teams_TeamId",
- column: x => x.TeamId,
- principalTable: "Teams",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
- migrationBuilder.CreateIndex(
- name: "IX_MeetingUser_MeetingId",
- table: "MeetingUser",
- column: "MeetingId");
- migrationBuilder.CreateIndex(
- name: "IX_TeamUser_TeamId",
- table: "TeamUser",
- column: "TeamId");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "MeetingUser");
- migrationBuilder.DropTable(
- name: "TeamUser");
- migrationBuilder.DropTable(
- name: "UserTaskLogs");
- migrationBuilder.DropTable(
- name: "Meetings");
- migrationBuilder.DropTable(
- name: "Teams");
- migrationBuilder.DropColumn(
- name: "CreateDate",
- table: "Projects");
- migrationBuilder.DropColumn(
- name: "CreateUser",
- table: "Projects");
- migrationBuilder.DropColumn(
- name: "DeleteUserId",
- table: "Projects");
- migrationBuilder.DropColumn(
- name: "IsDeleted",
- table: "Projects");
- migrationBuilder.DropColumn(
- name: "UpdateDate",
- table: "Projects");
- migrationBuilder.DropColumn(
- name: "UpdateUser",
- table: "Projects");
- migrationBuilder.AlterColumn<string>(
- name: "Comment",
- table: "UserTaskHistories",
- type: "nvarchar(500)",
- maxLength: 500,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "nvarchar(500)",
- oldMaxLength: 500,
- oldNullable: true);
- migrationBuilder.AlterColumn<string>(
- name: "FileName",
- table: "UserTaskAttachments",
- type: "nvarchar(250)",
- maxLength: 250,
- nullable: false,
- defaultValue: "",
- oldClrType: typeof(string),
- oldType: "nvarchar(250)",
- oldMaxLength: 250,
- oldNullable: true);
- }
- }
- }
|