mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18: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
|
|
{
|
|
/// <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: "character varying(20)",
|
|
maxLength: 20,
|
|
nullable: true,
|
|
oldClrType: typeof(string),
|
|
oldType: "character varying(20)",
|
|
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: "character varying(20)",
|
|
maxLength: 20,
|
|
nullable: false,
|
|
defaultValue: "",
|
|
oldClrType: typeof(string),
|
|
oldType: "character varying(20)",
|
|
oldMaxLength: 20,
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddUniqueConstraint(
|
|
name: "ak_clubs_name",
|
|
table: "clubs",
|
|
column: "name");
|
|
}
|
|
}
|
|
}
|