2022-02-14 00:18:53 +02:00
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
namespace West.TelegramBot.Reputation.Migrations;
|
|
|
|
|
|
|
|
|
|
public partial class Initial : Migration
|
2022-02-14 00:18:53 +02:00
|
|
|
{
|
2022-02-14 10:21:35 +02:00
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
2022-02-14 00:18:53 +02:00
|
|
|
{
|
2022-02-14 10:21:35 +02:00
|
|
|
migrationBuilder.AlterDatabase()
|
|
|
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
2022-02-14 00:18:53 +02:00
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
migrationBuilder.CreateTable(
|
2022-02-14 00:18:53 +02:00
|
|
|
name: "UserReputation",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
UserId = table.Column<long>(type: "bigint", nullable: false),
|
|
|
|
|
ChatId = table.Column<long>(type: "bigint", nullable: false),
|
|
|
|
|
Value = table.Column<double>(type: "double", nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_UserReputation", x => new { x.ChatId, x.UserId });
|
|
|
|
|
})
|
2022-02-14 10:21:35 +02:00
|
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
2022-02-14 00:18:53 +02:00
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_UserReputation_ChatId",
|
|
|
|
|
table: "UserReputation",
|
|
|
|
|
column: "ChatId");
|
|
|
|
|
}
|
2022-02-14 00:18:53 +02:00
|
|
|
|
2022-02-14 10:21:35 +02:00
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "UserReputation");
|
2022-02-14 00:18:53 +02:00
|
|
|
}
|
2022-02-14 10:21:35 +02:00
|
|
|
}
|