techgarage-ir.MTWireGuard/Application/Migrations/20230108171012_Initialize.cs

49 lines
1.5 KiB
C#
Raw Normal View History

2023-03-03 23:24:18 +03:30
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
2023-06-02 15:26:29 +03:30
namespace MTWireGuard.Application.Migrations
2023-03-03 23:24:18 +03:30
{
/// <inheritdoc />
public partial class Initialize : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
PrivateKey = table.Column<string>(type: "TEXT", nullable: false),
PublicKey = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Users_PrivateKey",
table: "Users",
column: "PrivateKey",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_Users_PublicKey",
table: "Users",
column: "PublicKey",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Users");
}
}
}