mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace NadekoBot.Db.Migrations.Sqlite
|
|
{
|
|
/// <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: "TEXT",
|
|
maxLength: 20,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT",
|
|
oldMaxLength: 20);
|
|
|
|
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.AlterColumn<string>(
|
|
name: "Name",
|
|
table: "Clubs",
|
|
type: "TEXT",
|
|
maxLength: 20,
|
|
nullable: false,
|
|
defaultValue: "",
|
|
oldClrType: typeof(string),
|
|
oldType: "TEXT",
|
|
oldMaxLength: 20,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddUniqueConstraint(
|
|
name: "AK_Clubs_Name",
|
|
table: "Clubs",
|
|
column: "Name");
|
|
}
|
|
}
|
|
}
|