Added clubrename command

This commit is contained in:
Cata
2023-09-04 00:41:33 +00:00
committed by Kwoth
parent f4b9c1c0e6
commit e158ba5b35
17 changed files with 10611 additions and 18 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,59 @@
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");
}
}
}

View File

@@ -144,7 +144,6 @@ namespace NadekoBot.Db.Migrations
.HasColumnName("imageurl");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)")
.HasColumnName("name");
@@ -160,8 +159,9 @@ namespace NadekoBot.Db.Migrations
b.HasKey("Id")
.HasName("pk_clubs");
b.HasAlternateKey("Name")
.HasName("ak_clubs_name");
b.HasIndex("Name")
.IsUnique()
.HasDatabaseName("ix_clubs_name");
b.HasIndex("OwnerId")
.IsUnique()