techgarage-ir.MTWireGuard/Application/Migrations/20230108171012_Initialize.cs
2023-06-28 18:01:39 +03:30

48 lines
1.5 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MTWireGuard.Application.Migrations
{
/// <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");
}
}
}