mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
74 lines
2.3 KiB
C#
74 lines
2.3 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace NadekoBot.Db.Migrations.Mysql
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class clubinfonameindex : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropUniqueConstraint(
|
|
name: "ak_clubs_name",
|
|
table: "clubs");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "name",
|
|
table: "clubs",
|
|
type: "varchar(20)",
|
|
maxLength: 20,
|
|
nullable: true,
|
|
collation: "utf8mb4_bin",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(20)",
|
|
oldMaxLength: 20,
|
|
oldCollation: "utf8mb4_bin")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_clubs_name",
|
|
table: "clubs",
|
|
column: "name",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "ix_clubs_name",
|
|
table: "clubs");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "clubs",
|
|
keyColumn: "name",
|
|
keyValue: null,
|
|
column: "name",
|
|
value: "");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "name",
|
|
table: "clubs",
|
|
type: "varchar(20)",
|
|
maxLength: 20,
|
|
nullable: false,
|
|
collation: "utf8mb4_bin",
|
|
oldClrType: typeof(string),
|
|
oldType: "varchar(20)",
|
|
oldMaxLength: 20,
|
|
oldNullable: true,
|
|
oldCollation: "utf8mb4_bin")
|
|
.Annotation("MySql:CharSet", "utf8mb4")
|
|
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddUniqueConstraint(
|
|
name: "ak_clubs_name",
|
|
table: "clubs",
|
|
column: "name");
|
|
}
|
|
}
|
|
}
|