mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
59 lines
2.1 KiB
C#
59 lines
2.1 KiB
C#
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||
|
|
|
||
|
|
#nullable disable
|
||
|
|
|
||
|
|
namespace Kruzya.TelegramBot.Core.Migrations
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
public partial class AddChatOptions : Migration
|
||
|
|
{
|
||
|
|
/// <inheritdoc />
|
||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||
|
|
{
|
||
|
|
migrationBuilder.CreateTable(
|
||
|
|
name: "ChatOptionValues",
|
||
|
|
columns: table => new
|
||
|
|
{
|
||
|
|
ChatId = table.Column<long>(type: "bigint", nullable: false),
|
||
|
|
OptionId = table.Column<string>(type: "varchar(255)", nullable: false)
|
||
|
|
.Annotation("MySql:CharSet", "utf8mb4"),
|
||
|
|
Value = table.Column<byte[]>(type: "longblob", nullable: false)
|
||
|
|
},
|
||
|
|
constraints: table =>
|
||
|
|
{
|
||
|
|
table.PrimaryKey("PK_ChatOptionValues", x => new { x.ChatId, x.OptionId });
|
||
|
|
})
|
||
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <inheritdoc />
|
||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||
|
|
{
|
||
|
|
migrationBuilder.DropTable(
|
||
|
|
name: "ChatOptionValues");
|
||
|
|
|
||
|
|
migrationBuilder.AlterColumn<string>(
|
||
|
|
name: "ValueType",
|
||
|
|
table: "UserValues",
|
||
|
|
type: "longtext CHARACTER SET utf8mb4",
|
||
|
|
nullable: true,
|
||
|
|
oldClrType: typeof(string),
|
||
|
|
oldType: "longtext",
|
||
|
|
oldNullable: true)
|
||
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||
|
|
|
||
|
|
migrationBuilder.AlterColumn<string>(
|
||
|
|
name: "Name",
|
||
|
|
table: "UserValues",
|
||
|
|
type: "longtext CHARACTER SET utf8mb4",
|
||
|
|
nullable: true,
|
||
|
|
oldClrType: typeof(string),
|
||
|
|
oldType: "longtext",
|
||
|
|
oldNullable: true)
|
||
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
||
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|