using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AsbCloudDb.Migrations
{
    /// <inheritdoc />
    public partial class Update_DetectedOperation : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<int>(
                name: "id_user",
                table: "t_detected_operation",
                type: "integer",
                nullable: true,
                comment: "Id пользователя по телеметрии на момент начала операции",
                oldClrType: typeof(int),
                oldType: "integer",
                oldComment: "Id пользователя по телеметрии на момент начала операции");

            migrationBuilder.AddColumn<DateTimeOffset>(
                name: "creation",
                table: "t_detected_operation",
                type: "timestamp with time zone",
                nullable: false,
                defaultValue: new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)),
                comment: "дата создания");

            migrationBuilder.AddColumn<int>(
                name: "id_editor",
                table: "t_detected_operation",
                type: "integer",
                nullable: true,
                comment: "Редактор");
        }

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

            migrationBuilder.DropColumn(
                name: "id_editor",
                table: "t_detected_operation");

            migrationBuilder.AlterColumn<int>(
                name: "id_user",
                table: "t_detected_operation",
                type: "integer",
                nullable: false,
                defaultValue: 0,
                comment: "Id пользователя по телеметрии на момент начала операции",
                oldClrType: typeof(int),
                oldType: "integer",
                oldNullable: true,
                oldComment: "Id пользователя по телеметрии на момент начала операции");
        }
    }
}