using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PARR.DAL.Migrations
{
///
public partial class tblRobotSnapshot : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "robot");
migrationBuilder.CreateTable(
name: "Snapshots",
schema: "robot",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
TemplateRobotsCount = table.Column(type: "integer", nullable: false, comment: "Количество запущенных роботов по шаблонам"),
ScheduleRobotsCount = table.Column(type: "integer", nullable: false, comment: "Количество запущенных роботов по расписаниям"),
MaxRobots = table.Column(type: "integer", nullable: false, comment: "Максимально разрешенное количество роботов на сервере"),
Ip = table.Column(type: "character varying(45)", maxLength: 45, nullable: false, comment: "Текущий IP-адрес сервера")
},
constraints: table =>
{
table.PrimaryKey("PK_Snapshots", x => x.Id);
},
comment: "Снимки роботов");
migrationBuilder.UpdateData(
table: "Settings",
keyColumn: "Name",
keyValue: "RobotWaitTime",
column: "Value",
value: "00:10:00");
migrationBuilder.CreateIndex(
name: "IX_Snapshots_Ip_DateCreated",
schema: "robot",
table: "Snapshots",
columns: new[] { "Ip", "DateCreated" });
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Snapshots",
schema: "robot");
migrationBuilder.UpdateData(
table: "Settings",
keyColumn: "Name",
keyValue: "RobotWaitTime",
column: "Value",
value: "00:15:00");
}
}
}