90 lines
3.8 KiB
C#
90 lines
3.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using WorkerService1.Domains;
|
|
|
|
#nullable disable
|
|
|
|
namespace AutoDispathingWork.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class initDb : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "ClientOptions",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ApiGateway = table.Column<string>(type: "text", nullable: false),
|
|
UserName = table.Column<string>(type: "text", nullable: false),
|
|
Password = table.Column<string>(type: "text", nullable: false),
|
|
Delay = table.Column<int>(type: "integer", nullable: false),
|
|
DispatchingRunning = table.Column<bool>(type: "boolean", nullable: false),
|
|
CloseFileRunning = table.Column<bool>(type: "boolean", nullable: false),
|
|
LoginApi = table.Column<string>(type: "text", nullable: false),
|
|
GetTaskApi = table.Column<string>(type: "text", nullable: false),
|
|
GetUserApi = table.Column<string>(type: "text", nullable: false),
|
|
DiposeOrder = table.Column<string>(type: "text", nullable: false),
|
|
CloseFileApi = table.Column<string>(type: "text", nullable: false),
|
|
GetCamerasApi = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_ClientOptions", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "LogInfos",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Message = table.Column<string>(type: "text", nullable: false),
|
|
From = table.Column<string>(type: "text", nullable: false),
|
|
Level = table.Column<string>(type: "text", nullable: false),
|
|
CreateTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_LogInfos", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Polygons",
|
|
columns: table => new
|
|
{
|
|
PolygonId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "text", nullable: false),
|
|
UserId = table.Column<string>(type: "text", nullable: true),
|
|
UserName = table.Column<string>(type: "text", nullable: true),
|
|
Points = table.Column<List<List<Points>>>(type: "jsonb", nullable: true),
|
|
RangeCameras = table.Column<List<string>>(type: "jsonb", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Polygons", x => x.PolygonId);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_LogInfos_CreateTime",
|
|
table: "LogInfos",
|
|
column: "CreateTime");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "ClientOptions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "LogInfos");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Polygons");
|
|
}
|
|
}
|
|
}
|