mirror of
https://github.com/techgarage-ir/MTWireGuard.git
synced 2025-08-31 23:20:11 +02:00
Update db migrations with new objects and fields
This commit is contained in:
parent
115f657738
commit
24c99bf691
17 changed files with 1450 additions and 0 deletions
61
Application/Migrations/20230906130735_AddDataUsage.cs
Normal file
61
Application/Migrations/20230906130735_AddDataUsage.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
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");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue