mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-30 06:39:27 +02:00
62 lines
2 KiB
C#
62 lines
2 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace MTWireGuard.Application.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class AddDataUsage : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "RX",
|
|||
|
table: "Users",
|
|||
|
type: "INTEGER",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0);
|
|||
|
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "TX",
|
|||
|
table: "Users",
|
|||
|
type: "INTEGER",
|
|||
|
nullable: false,
|
|||
|
defaultValue: 0);
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "DataUsages",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|||
|
.Annotation("Sqlite:Autoincrement", true),
|
|||
|
UserID = table.Column<int>(type: "INTEGER", nullable: false),
|
|||
|
RX = table.Column<int>(type: "INTEGER", nullable: false),
|
|||
|
TX = table.Column<int>(type: "INTEGER", nullable: false),
|
|||
|
UserReset = table.Column<bool>(type: "INTEGER", nullable: false),
|
|||
|
CreationTime = table.Column<DateTime>(type: "TEXT", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_DataUsages", x => x.Id);
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "DataUsages");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "RX",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "TX",
|
|||
|
table: "Users");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|