techgarage-ir.MTWireGuard/Application/Migrations/20231010194742_AddLastKnownTraffic.cs
2024-01-25 20:34:54 +03:30

59 lines
1.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWireGuard.Application.Migrations
{
/// <inheritdoc />
public partial class AddLastKnownTraffic : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ResetNotes",
table: "DataUsages",
type: "TEXT",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "SystemReset",
table: "DataUsages",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "LastKnownTraffic",
columns: table => new
{
UserID = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RX = table.Column<int>(type: "INTEGER", nullable: false),
TX = table.Column<int>(type: "INTEGER", nullable: false),
CreationTime = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_LastKnownTraffic", x => x.UserID);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LastKnownTraffic");
migrationBuilder.DropColumn(
name: "ResetNotes",
table: "DataUsages");
migrationBuilder.DropColumn(
name: "SystemReset",
table: "DataUsages");
}
}
}