12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- namespace SuZhou_SIPAC_Client.Migrations
- {
- public partial class init : Migration
- {
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "InverterAccumulatedDatas",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- 当日有功发电量 = table.Column<decimal>(type: "TEXT", nullable: false),
- 当日无功发电量 = table.Column<decimal>(type: "TEXT", nullable: false),
- 当月有功发电量 = table.Column<decimal>(type: "TEXT", nullable: true),
- 当月无功发电量 = table.Column<decimal>(type: "TEXT", nullable: true),
- 当年有功发电量 = table.Column<decimal>(type: "TEXT", nullable: true),
- 当年无功发电量 = table.Column<decimal>(type: "TEXT", nullable: true),
- CreatedTimeStamp = table.Column<DateTime>(type: "TEXT", nullable: false),
- HttpPostResponseReceivedTime = table.Column<DateTime>(type: "TEXT", nullable: true),
- HttpPostResponse = table.Column<string>(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_InverterAccumulatedDatas", x => x.Id);
- });
- migrationBuilder.CreateTable(
- name: "InverterRealTimeDatas",
- columns: table => new
- {
- Id = table.Column<int>(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- DeviceName = table.Column<string>(type: "TEXT", nullable: true),
- DeviceDescription = table.Column<string>(type: "TEXT", nullable: true),
- DeviceSlaveAddress = table.Column<int>(type: "INTEGER", nullable: false),
- Raw_当日有功发电量 = table.Column<decimal>(type: "TEXT", nullable: false),
- Raw_当日无功发电量 = table.Column<decimal>(type: "TEXT", nullable: false),
- ReadTimeStamp = table.Column<DateTime>(type: "TEXT", nullable: false),
- InverterAccumulatedDataModelId = table.Column<int>(type: "INTEGER", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_InverterRealTimeDatas", x => x.Id);
- table.ForeignKey(
- name: "FK_InverterRealTimeDatas_InverterAccumulatedDatas_InverterAccumulatedDataModelId",
- column: x => x.InverterAccumulatedDataModelId,
- principalTable: "InverterAccumulatedDatas",
- principalColumn: "Id",
- onDelete: ReferentialAction.Restrict);
- });
- migrationBuilder.CreateIndex(
- name: "IX_InverterAccumulatedDatas_Id",
- table: "InverterAccumulatedDatas",
- column: "Id",
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_InverterRealTimeDatas_Id",
- table: "InverterRealTimeDatas",
- column: "Id",
- unique: true);
- migrationBuilder.CreateIndex(
- name: "IX_InverterRealTimeDatas_InverterAccumulatedDataModelId",
- table: "InverterRealTimeDatas",
- column: "InverterAccumulatedDataModelId");
- migrationBuilder.CreateIndex(
- name: "IX_InverterRealTimeDatas_ReadTimeStamp",
- table: "InverterRealTimeDatas",
- column: "ReadTimeStamp");
- }
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "InverterRealTimeDatas");
- migrationBuilder.DropTable(
- name: "InverterAccumulatedDatas");
- }
- }
- }
|