using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MTWireGuard.Application.Migrations { /// public partial class AddDataUsage : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "RX", table: "Users", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "TX", table: "Users", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.CreateTable( name: "DataUsages", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), UserID = table.Column(type: "INTEGER", nullable: false), RX = table.Column(type: "INTEGER", nullable: false), TX = table.Column(type: "INTEGER", nullable: false), UserReset = table.Column(type: "INTEGER", nullable: false), CreationTime = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_DataUsages", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "DataUsages"); migrationBuilder.DropColumn( name: "RX", table: "Users"); migrationBuilder.DropColumn( name: "TX", table: "Users"); } } }