mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
Added clubrename command
This commit is contained in:
3633
src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs
generated
Normal file
3633
src/NadekoBot/Migrations/Mysql/20230903153202_clubinfo-name-index.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
@@ -135,7 +135,6 @@ namespace NadekoBot.Db.Migrations.Mysql
|
||||
.HasColumnName("imageurl");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("varchar(20)")
|
||||
.HasColumnName("name")
|
||||
@@ -152,8 +151,9 @@ namespace NadekoBot.Db.Migrations.Mysql
|
||||
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()
|
||||
|
3781
src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs
generated
Normal file
3781
src/NadekoBot/Migrations/Postgresql/20230903154851_clubinfo-name-index.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
@@ -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()
|
||||
|
2914
src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs
generated
Normal file
2914
src/NadekoBot/Migrations/Sqlite/20230903153230_clubinfo-name-index.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
@@ -109,7 +109,6 @@ namespace NadekoBot.Db.Migrations.Sqlite
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
@@ -121,7 +120,8 @@ namespace NadekoBot.Db.Migrations.Sqlite
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAlternateKey("Name");
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("OwnerId")
|
||||
.IsUnique();
|
||||
|
Reference in New Issue
Block a user