mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-29 22:29:24 +02:00
59 lines
1.9 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|