Files
nadekobot/src/NadekoBot/Migrations/Sqlite/20240423153708_sticky-roles.cs
2024-04-27 16:03:48 +00:00

55 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NadekoBot.Db.Migrations.Sqlite
{
/// <inheritdoc />
public partial class stickyroles : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "StickyRoles",
table: "GuildConfigs",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.CreateTable(
name: "StickyRoles",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
GuildId = table.Column<ulong>(type: "INTEGER", nullable: false),
RoleIds = table.Column<string>(type: "TEXT", nullable: false),
UserId = table.Column<ulong>(type: "INTEGER", nullable: false),
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StickyRoles", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_StickyRoles_GuildId_UserId",
table: "StickyRoles",
columns: new[] { "GuildId", "UserId" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StickyRoles");
migrationBuilder.DropColumn(
name: "StickyRoles",
table: "GuildConfigs");
}
}
}