iotgateway/IoTGateway.DataAccess/Migrations/20220413084526_rpclog.cs
2022-04-13 17:01:24 +08:00

49 lines
1.8 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IoTGateway.DataAccess.Migrations
{
public partial class rpclog : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "RpcLogs",
columns: table => new
{
ID = table.Column<Guid>(type: "TEXT", nullable: false),
RpcSide = table.Column<int>(type: "INTEGER", nullable: false),
StartTime = table.Column<DateTime>(type: "TEXT", nullable: false),
DeviceId = table.Column<Guid>(type: "TEXT", nullable: true),
Method = table.Column<string>(type: "TEXT", nullable: true),
Params = table.Column<string>(type: "TEXT", nullable: true),
EndTime = table.Column<DateTime>(type: "TEXT", nullable: false),
IsSuccess = table.Column<bool>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RpcLogs", x => x.ID);
table.ForeignKey(
name: "FK_RpcLogs_Devices_DeviceId",
column: x => x.DeviceId,
principalTable: "Devices",
principalColumn: "ID");
});
migrationBuilder.CreateIndex(
name: "IX_RpcLogs_DeviceId",
table: "RpcLogs",
column: "DeviceId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RpcLogs");
}
}
}