techgarage-ir.MTWireGuard/Application/Migrations/20230906130735_AddDataUsage.cs

62 lines
2 KiB
C#
Raw Normal View History

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");
}
}
}