WiP storage for modules

This commit is contained in:
2020-03-08 01:55:50 +04:00
parent 768a0d064f
commit 3fd5042367
11 changed files with 375 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Kruzya.TelegramBot.Core.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Users",
columns: table => new
{
BotUserId = table.Column<Guid>(nullable: false),
ChatId = table.Column<long>(nullable: false),
UserId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.BotUserId);
});
migrationBuilder.CreateTable(
name: "UserValues",
columns: table => new
{
BotUserValueId = table.Column<Guid>(nullable: false),
BotUserId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(nullable: true),
Value = table.Column<byte[]>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UserValues", x => x.BotUserValueId);
table.ForeignKey(
name: "FK_UserValues_Users_BotUserId",
column: x => x.BotUserId,
principalTable: "Users",
principalColumn: "BotUserId",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_UserValues_BotUserId",
table: "UserValues",
column: "BotUserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserValues");
migrationBuilder.DropTable(
name: "Users");
}
}
}