reinitialized migrations, finished migrate.sh script
This commit is contained in:
parent
2138d94d56
commit
ba01b9ae6a
161 changed files with 5191 additions and 257645 deletions
src/EllieBot/Migrations
MigrationQueries.cs
PostgreSql
20220409170719_mysql-init.Designer.cs20220428044547_stondel.Designer.cs20220428044547_stondel.cs20220429044808_bank.Designer.cs20220429044808_bank.cs20220504162457_new-rero.Designer.cs20220504162457_new-rero.cs20220614071421_patronage-system.Designer.cs20220614071421_patronage-system.cs20220623090729_stondel-db-cache.Designer.cs20220623090729_stondel-db-cache.cs20220703194412_logwarns.Designer.cs20220703194412_logwarns.cs20220725155941_xpitemshop.Designer.cs20220725155941_xpitemshop.cs20220727033944_linkonly-channels.Designer.cs20220727033944_linkonly-channels.cs20220808142559_remove-obsolete-xp-columns.Designer.cs20220808142559_remove-obsolete-xp-columns.cs20220831142735_banprune.Designer.cs20220831142735_banprune.cs20220913192529_shop-role-req.Designer.cs20220913192529_shop-role-req.cs20220916194523_autopub.Designer.cs20220916194523_autopub.cs20221003175752_gambling-stats.Designer.cs20221003175752_gambling-stats.cs20221021192807_toggle-global-expressions.Designer.cs20221021192807_toggle-global-expressions.cs20221118195200_log-thread.Designer.cs20221118195200_log-thread.cs20221122204423_feed-text.Designer.cs20221122204423_feed-text.cs20240502233202_v5.Designer.cs20240502233202_v5.cs20240518221432_guidlconfig-cleanup.Designer.cs20240518221432_guidlconfig-cleanup.cs20240611180506_remove-patron-limits.Designer.cs20240611180506_remove-patron-limits.cs20240627033522_honeypot.Designer.cs20240627033522_honeypot.cs20240912124719_greet-settings.Designer.cs20240912124719_greet-settings.cs20241018004623_warn-split.Designer.cs20241018004623_warn-split.cs20241028033704_ncanvas.Designer.cs20241028033704_ncanvas.cs20241102022956_no-discrim-and-flag-translate.Designer.cs20241102022956_no-discrim-and-flag-translate.cs20241105024753_betstats.Designer.cs20241105024753_betstats.cs20241107051622_rakeback.Designer.cs20241107051622_rakeback.cs20241126033634_btnroles_guildcolors.Designer.cs20241126033634_btnroles_guildcolors.cs20241127092257_sar-rework.Designer.cs20241127092257_sar-rework.cs20241207150050_awardedxp-temprole-notify.cs20250114060020_fishes.Designer.cs20250114060020_fishes.cs20250121032937_fish-skill.Designer.cs20250121032937_fish-skill.cs20250123191330_init.Designer.cs20250123191330_init.csPostgreSqlContextModelSnapshot.cs
Sqlite
20210621042359_squash.Designer.cs20210707002343_cleanup.Designer.cs20210707002343_cleanup.cs20210911225622_rero-cascade.Designer.cs20210911225622_rero-cascade.cs20210912182515_boost-messages.Designer.cs20210912182515_boost-messages.cs20210912200106_logsettings-independence.Designer.cs20210912200106_logsettings-independence.cs20210914180026_image-only-channels.Designer.cs20210914180026_image-only-channels.cs20210921204645_logignore-user-channel.Designer.cs20210921204645_logignore-user-channel.cs20211015232708_nsfw-blacklist-tags.Designer.cs20211015232708_nsfw-blacklist-tags.cs20211121002508_weighted-warnings.Designer.cs20211121002508_weighted-warnings.cs20211213145407_atl-rework.Designer.cs20211213145407_atl-rework.cs20220102102344_crs-rename-to-expressions-perm-rename.Designer.cs20220102102344_crs-rename-to-expressions-perm-rename.cs20220110105942_filter-settings-cleanup.Designer.cs20220110105942_filter-settings-cleanup.cs20220125044401_curtrs-rework-discorduser-defaults.Designer.cs20220125044401_curtrs-rework-discorduser-defaults.cs20220213123633_music-autoplay.Designer.cs20220213123633_music-autoplay.cs20220409170828_clubs-refactor.Designer.cs20220409170828_clubs-refactor.cs20220427200557_stondel.Designer.cs20220427200557_stondel.cs20220428051304_bank.Designer.cs20220428051304_bank.cs20220503234243_new-rero.Designer.cs
|
@ -1,133 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations;
|
||||
|
||||
public static class MigrationQueries
|
||||
{
|
||||
public static void MergeAwardedXp(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("""
|
||||
UPDATE UserXpStats
|
||||
SET Xp = AwardedXp + Xp,
|
||||
AwardedXp = 0
|
||||
WHERE AwardedXp > 0;
|
||||
""");
|
||||
}
|
||||
|
||||
public static void MigrateSar(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
if (migrationBuilder.IsNpgsql())
|
||||
return;
|
||||
|
||||
migrationBuilder.Sql("""
|
||||
INSERT INTO GroupName (Number, GuildConfigId)
|
||||
SELECT DISTINCT "Group", GC.Id
|
||||
FROM SelfAssignableRoles as SAR
|
||||
INNER JOIN GuildConfigs as GC
|
||||
ON SAR.GuildId = GC.GuildId
|
||||
WHERE SAR.GuildId not in (SELECT GuildConfigs.GuildId from GroupName LEFT JOIN GuildConfigs ON GroupName.GuildConfigId = GuildConfigs.Id);
|
||||
|
||||
INSERT INTO SarGroup (Id, GroupNumber, Name, IsExclusive, GuildId)
|
||||
SELECT GN.Id, GN.Number, GN.Name, GC.ExclusiveSelfAssignedRoles, GC.GuildId
|
||||
FROM GroupName as GN
|
||||
INNER JOIN GuildConfigs as GC ON GN.GuildConfigId = GC.Id;
|
||||
|
||||
INSERT INTO Sar (GuildId, RoleId, SarGroupId, LevelReq)
|
||||
SELECT SAR.GuildId, SAR.RoleId, (SELECT Id FROM SarGroup WHERE SG.Number = SarGroup.GroupNumber AND SG.GuildId = SarGroup.GuildId), MIN(SAR.LevelRequirement)
|
||||
FROM SelfAssignableRoles as SAR
|
||||
INNER JOIN (SELECT GuildId, gn.Number FROM GroupName as gn
|
||||
INNER JOIN GuildConfigs as gc ON gn.GuildConfigId =gc.Id
|
||||
) as SG
|
||||
ON SG.GuildId = SAR.GuildId
|
||||
WHERE SG.Number IN (SELECT GroupNumber FROM SarGroup WHERE Sar.GuildId = SarGroup.GuildId)
|
||||
GROUP BY SAR.GuildId, SAR.RoleId;
|
||||
|
||||
INSERT INTO SarAutoDelete (GuildId, IsEnabled)
|
||||
SELECT GuildId, AutoDeleteSelfAssignedRoleMessages FROM GuildConfigs WHERE AutoDeleteSelfAssignedRoleMessages = TRUE;
|
||||
""");
|
||||
}
|
||||
|
||||
public static void UpdateUsernames(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("UPDATE DiscordUser SET Username = '??' || Username WHERE Discriminator = '????';");
|
||||
}
|
||||
|
||||
public static void MigrateRero(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
if (migrationBuilder.IsSqlite())
|
||||
{
|
||||
migrationBuilder.Sql(
|
||||
@"insert or ignore into reactionroles(guildid, channelid, messageid, emote, roleid, 'group', levelreq, dateadded)
|
||||
select guildid, channelid, messageid, emotename, roleid, exclusive, 0, reactionrolemessage.dateadded
|
||||
from reactionrole
|
||||
left join reactionrolemessage on reactionrolemessage.id = reactionrole.reactionrolemessageid
|
||||
left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;");
|
||||
}
|
||||
else if (migrationBuilder.IsNpgsql())
|
||||
{
|
||||
migrationBuilder.Sql(
|
||||
@"insert into reactionroles(guildid, channelid, messageid, emote, roleid, ""group"", levelreq, dateadded)
|
||||
select guildid, channelid, messageid, emotename, roleid, exclusive::int, 0, reactionrolemessage.dateadded
|
||||
from reactionrole
|
||||
left join reactionrolemessage on reactionrolemessage.id = reactionrole.reactionrolemessageid
|
||||
left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id
|
||||
ON CONFLICT DO NOTHING;");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("This database provider doesn't have an implementation for MigrateRero");
|
||||
}
|
||||
}
|
||||
|
||||
public static void GuildConfigCleanup(MigrationBuilder builder)
|
||||
{
|
||||
builder.Sql($"""
|
||||
DELETE FROM "DelMsgOnCmdChannel" WHERE "GuildConfigId" is NULL;
|
||||
DELETE FROM "WarningPunishment" WHERE "GuildConfigId" NOT IN (SELECT "Id" from "GuildConfigs");
|
||||
DELETE FROM "StreamRoleBlacklistedUser" WHERE "StreamRoleSettingsId" is NULL;
|
||||
DELETE FROM "Permissions" WHERE "GuildConfigId" NOT IN (SELECT "Id" from "GuildConfigs");
|
||||
""");
|
||||
}
|
||||
|
||||
public static void GreetSettingsCopy(MigrationBuilder builder)
|
||||
{
|
||||
builder.Sql("""
|
||||
INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer)
|
||||
SELECT GuildId, 0, ChannelGreetMessageText, SendChannelGreetMessage, GreetMessageChannelId, AutoDeleteGreetMessagesTimer
|
||||
FROM GuildConfigs
|
||||
WHERE SendChannelGreetMessage = TRUE;
|
||||
|
||||
INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer)
|
||||
SELECT GuildId, 1, DmGreetMessageText, SendDmGreetMessage, GreetMessageChannelId, 0
|
||||
FROM GuildConfigs
|
||||
WHERE SendDmGreetMessage = TRUE;
|
||||
|
||||
INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer)
|
||||
SELECT GuildId, 2, ChannelByeMessageText, SendChannelByeMessage, ByeMessageChannelId, AutoDeleteByeMessagesTimer
|
||||
FROM GuildConfigs
|
||||
WHERE SendChannelByeMessage = TRUE;
|
||||
|
||||
INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer)
|
||||
SELECT GuildId, 3, BoostMessage, SendBoostMessage, BoostMessageChannelId, BoostMessageDeleteAfter
|
||||
FROM GuildConfigs
|
||||
WHERE SendBoostMessage = TRUE;
|
||||
""");
|
||||
}
|
||||
|
||||
public static void AddGuildIdsToWarningPunishment(MigrationBuilder builder)
|
||||
{
|
||||
builder.Sql("""
|
||||
DELETE FROM WarningPunishment WHERE GuildConfigId IS NULL OR GuildConfigId NOT IN (SELECT Id FROM GuildConfigs);
|
||||
UPDATE WarningPunishment
|
||||
SET GuildId = (SELECT GuildId FROM GuildConfigs WHERE Id = GuildConfigId);
|
||||
|
||||
DELETE FROM WarningPunishment as wp
|
||||
WHERE (wp.Count, wp.GuildConfigId) in (
|
||||
SELECT wp2.Count, wp2.GuildConfigId FROM WarningPunishment as wp2
|
||||
GROUP BY wp2.Count, wp2.GuildConfigId
|
||||
HAVING COUNT(id) > 1
|
||||
);
|
||||
""");
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class stondel : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "deletestreamonlinemessage",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "deletestreamonlinemessage",
|
||||
table: "guildconfigs");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,40 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class bank : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "bankusers",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
balance = table.Column<long>(type: "bigint", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_bankusers", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_bankusers_userid",
|
||||
table: "bankusers",
|
||||
column: "userid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "bankusers");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,114 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class newrero : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "reactionroles",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
emote = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
group = table.Column<int>(type: "integer", nullable: false),
|
||||
levelreq = table.Column<int>(type: "integer", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_reactionroles", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_reactionroles_guildid",
|
||||
table: "reactionroles",
|
||||
column: "guildid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_reactionroles_messageid_emote",
|
||||
table: "reactionroles",
|
||||
columns: new[] { "messageid", "emote" },
|
||||
unique: true);
|
||||
|
||||
MigrationQueries.MigrateRero(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "reactionrole");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "reactionrolemessage");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "reactionroles");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "reactionrolemessage",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildconfigid = table.Column<int>(type: "integer", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
exclusive = table.Column<bool>(type: "boolean", nullable: false),
|
||||
index = table.Column<int>(type: "integer", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_reactionrolemessage", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_reactionrolemessage_guildconfigs_guildconfigid",
|
||||
column: x => x.guildconfigid,
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "reactionrole",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
emotename = table.Column<string>(type: "text", nullable: true),
|
||||
reactionrolemessageid = table.Column<int>(type: "integer", nullable: true),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_reactionrole", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_reactionrole_reactionrolemessage_reactionrolemessageid",
|
||||
column: x => x.reactionrolemessageid,
|
||||
principalTable: "reactionrolemessage",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_reactionrole_reactionrolemessageid",
|
||||
table: "reactionrole",
|
||||
column: "reactionrolemessageid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_reactionrolemessage_guildconfigid",
|
||||
table: "reactionrolemessage",
|
||||
column: "guildconfigid");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,169 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class patronagesystem : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "patreonuserid",
|
||||
table: "rewardedusers",
|
||||
newName: "platformuserid");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "ix_rewardedusers_patreonuserid",
|
||||
table: "rewardedusers",
|
||||
newName: "ix_rewardedusers_platformuserid");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "xp",
|
||||
table: "userxpstats",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "awardedxp",
|
||||
table: "userxpstats",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "amountrewardedthismonth",
|
||||
table: "rewardedusers",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AlterColumn<bool>(
|
||||
name: "verboseerrors",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: true,
|
||||
oldClrType: typeof(bool),
|
||||
oldType: "boolean");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "totalxp",
|
||||
table: "discorduser",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldDefaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "patronquotas",
|
||||
columns: table => new
|
||||
{
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
featuretype = table.Column<int>(type: "integer", nullable: false),
|
||||
feature = table.Column<string>(type: "text", nullable: false),
|
||||
hourlycount = table.Column<long>(type: "bigint", nullable: false),
|
||||
dailycount = table.Column<long>(type: "bigint", nullable: false),
|
||||
monthlycount = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "patrons",
|
||||
columns: table => new
|
||||
{
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
uniqueplatformuserid = table.Column<string>(type: "text", nullable: true),
|
||||
amountcents = table.Column<int>(type: "integer", nullable: false),
|
||||
lastcharge = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
validthru = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_patrons", x => x.userid);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_patronquotas_userid",
|
||||
table: "patronquotas",
|
||||
column: "userid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_patrons_uniqueplatformuserid",
|
||||
table: "patrons",
|
||||
column: "uniqueplatformuserid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "patronquotas");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "patrons");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "platformuserid",
|
||||
table: "rewardedusers",
|
||||
newName: "patreonuserid");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "ix_rewardedusers_platformuserid",
|
||||
table: "rewardedusers",
|
||||
newName: "ix_rewardedusers_patreonuserid");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "xp",
|
||||
table: "userxpstats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "awardedxp",
|
||||
table: "userxpstats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "amountrewardedthismonth",
|
||||
table: "rewardedusers",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint");
|
||||
|
||||
migrationBuilder.AlterColumn<bool>(
|
||||
name: "verboseerrors",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
oldClrType: typeof(bool),
|
||||
oldType: "boolean",
|
||||
oldDefaultValue: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "totalxp",
|
||||
table: "discorduser",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "bigint",
|
||||
oldDefaultValue: 0L);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,36 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class stondeldbcache : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "streamonlinemessages",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
type = table.Column<int>(type: "integer", nullable: false),
|
||||
name = table.Column<string>(type: "text", nullable: true),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_streamonlinemessages", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "streamonlinemessages");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,25 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class logwarns : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "logwarnsid",
|
||||
table: "logsettings",
|
||||
type: "numeric(20,0)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "logwarnsid",
|
||||
table: "logsettings");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,42 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class xpitemshop : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "xpshopowneditem",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
itemtype = table.Column<int>(type: "integer", nullable: false),
|
||||
isusing = table.Column<bool>(type: "boolean", nullable: false),
|
||||
itemkey = table.Column<string>(type: "text", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_xpshopowneditem", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_xpshopowneditem_userid_itemtype_itemkey",
|
||||
table: "xpshopowneditem",
|
||||
columns: new[] { "userid", "itemtype", "itemkey" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "xpshopowneditem");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class linkonlychannels : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "type",
|
||||
table: "imageonlychannels",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "type",
|
||||
table: "imageonlychannels");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,25 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class banprune : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "prunedays",
|
||||
table: "bantemplates",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "prunedays",
|
||||
table: "bantemplates");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,25 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class shoprolereq : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "rolerequirement",
|
||||
table: "shopentry",
|
||||
type: "numeric(20,0)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "rolerequirement",
|
||||
table: "shopentry");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,40 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class autopub : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "autopublishchannel",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_autopublishchannel", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_autopublishchannel_guildid",
|
||||
table: "autopublishchannel",
|
||||
column: "guildid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "autopublishchannel");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,41 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class gamblingstats : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "gamblingstats",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
feature = table.Column<string>(type: "text", nullable: true),
|
||||
bet = table.Column<decimal>(type: "numeric", nullable: false),
|
||||
paidout = table.Column<decimal>(type: "numeric", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_gamblingstats", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_gamblingstats_feature",
|
||||
table: "gamblingstats",
|
||||
column: "feature",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "gamblingstats");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class toggleglobalexpressions : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "disableglobalexpressions",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "disableglobalexpressions",
|
||||
table: "guildconfigs");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,35 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class logthread : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "threadcreatedid",
|
||||
table: "logsettings",
|
||||
type: "numeric(20,0)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "threaddeletedid",
|
||||
table: "logsettings",
|
||||
type: "numeric(20,0)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "threadcreatedid",
|
||||
table: "logsettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "threaddeletedid",
|
||||
table: "logsettings");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,25 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
public partial class feedtext : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "message",
|
||||
table: "feedsub",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "message",
|
||||
table: "feedsub");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,326 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class v5 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "nsfwblacklistedtags");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "pollanswer");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "pollvote");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "poll");
|
||||
|
||||
migrationBuilder.DropUniqueConstraint(
|
||||
name: "ak_clubs_name",
|
||||
table: "clubs");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "command",
|
||||
table: "shopentry",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "type",
|
||||
table: "reminders",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "stickyroles",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
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.CreateTable(
|
||||
name: "giveawaymodel",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
message = table.Column<string>(type: "text", nullable: true),
|
||||
endsat = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_giveawaymodel", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "stickyroles",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
roleids = table.Column<string>(type: "text", nullable: true),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_stickyroles", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "todosarchive",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
name = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_todosarchive", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "giveawayuser",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
giveawayid = table.Column<int>(type: "integer", nullable: false),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
name = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_giveawayuser", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_giveawayuser_giveawaymodel_giveawayid",
|
||||
column: x => x.giveawayid,
|
||||
principalTable: "giveawaymodel",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "todos",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
todo = table.Column<string>(type: "text", nullable: true),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
isdone = table.Column<bool>(type: "boolean", nullable: false),
|
||||
archiveid = table.Column<int>(type: "integer", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_todos", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_todos_todosarchive_archiveid",
|
||||
column: x => x.archiveid,
|
||||
principalTable: "todosarchive",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_clubs_name",
|
||||
table: "clubs",
|
||||
column: "name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_giveawayuser_giveawayid_userid",
|
||||
table: "giveawayuser",
|
||||
columns: new[] { "giveawayid", "userid" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_stickyroles_guildid_userid",
|
||||
table: "stickyroles",
|
||||
columns: new[] { "guildid", "userid" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_todos_archiveid",
|
||||
table: "todos",
|
||||
column: "archiveid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_todos_userid",
|
||||
table: "todos",
|
||||
column: "userid");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "giveawayuser");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "stickyroles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "todos");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "giveawaymodel");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "todosarchive");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_clubs_name",
|
||||
table: "clubs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "command",
|
||||
table: "shopentry");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "type",
|
||||
table: "reminders");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "stickyroles",
|
||||
table: "guildconfigs");
|
||||
|
||||
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");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "nsfwblacklistedtags",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
tag = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_nsfwblacklistedtags", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "poll",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
question = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_poll", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pollanswer",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
index = table.Column<int>(type: "integer", nullable: false),
|
||||
pollid = table.Column<int>(type: "integer", nullable: true),
|
||||
text = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_pollanswer", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_pollanswer_poll_pollid",
|
||||
column: x => x.pollid,
|
||||
principalTable: "poll",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pollvote",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
pollid = table.Column<int>(type: "integer", nullable: true),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
voteindex = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_pollvote", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_pollvote_poll_pollid",
|
||||
column: x => x.pollid,
|
||||
principalTable: "poll",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_nsfwblacklistedtags_guildid",
|
||||
table: "nsfwblacklistedtags",
|
||||
column: "guildid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_poll_guildid",
|
||||
table: "poll",
|
||||
column: "guildid",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_pollanswer_pollid",
|
||||
table: "pollanswer",
|
||||
column: "pollid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_pollvote_pollid",
|
||||
table: "pollvote",
|
||||
column: "pollid");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,701 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class guidlconfigcleanup : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antiraidsetting_guildconfigs_guildconfigid",
|
||||
table: "antiraidsetting");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antispamignore_antispamsetting_antispamsettingid",
|
||||
table: "antispamignore");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antispamsetting_guildconfigs_guildconfigid",
|
||||
table: "antispamsetting");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_commandalias_guildconfigs_guildconfigid",
|
||||
table: "commandalias");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_commandcooldown_guildconfigs_guildconfigid",
|
||||
table: "commandcooldown");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid",
|
||||
table: "delmsgoncmdchannel");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_excludeditem_xpsettings_xpsettingsid",
|
||||
table: "excludeditem");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterchannelid_guildconfigs_guildconfigid",
|
||||
table: "filterchannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filteredword_guildconfigs_guildconfigid",
|
||||
table: "filteredword");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterlinkschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterlinkschannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterwordschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterwordschannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_followedstream_guildconfigs_guildconfigid",
|
||||
table: "followedstream");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_gcchannelid_guildconfigs_guildconfigid",
|
||||
table: "gcchannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_muteduserid_guildconfigs_guildconfigid",
|
||||
table: "muteduserid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_permissions_guildconfigs_guildconfigid",
|
||||
table: "permissions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_shopentry_guildconfigs_guildconfigid",
|
||||
table: "shopentry");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_shopentryitem_shopentry_shopentryid",
|
||||
table: "shopentryitem");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoredrole");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoreduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamroleblacklisteduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamrolewhitelisteduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unbantimer_guildconfigs_guildconfigid",
|
||||
table: "unbantimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unmutetimer_guildconfigs_guildconfigid",
|
||||
table: "unmutetimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unroletimer_guildconfigs_guildconfigid",
|
||||
table: "unroletimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_vcroleinfo_guildconfigs_guildconfigid",
|
||||
table: "vcroleinfo");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ignoredvoicepresencechannels");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "streamrolesettingsid",
|
||||
table: "streamrolewhitelisteduser",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "streamrolesettingsid",
|
||||
table: "streamroleblacklisteduser",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "guildconfigid",
|
||||
table: "delmsgoncmdchannel",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antiraidsetting_guildconfigs_guildconfigid",
|
||||
table: "antiraidsetting",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antispamignore_antispamsetting_antispamsettingid",
|
||||
table: "antispamignore",
|
||||
column: "antispamsettingid",
|
||||
principalTable: "antispamsetting",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antispamsetting_guildconfigs_guildconfigid",
|
||||
table: "antispamsetting",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_commandalias_guildconfigs_guildconfigid",
|
||||
table: "commandalias",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_commandcooldown_guildconfigs_guildconfigid",
|
||||
table: "commandcooldown",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid",
|
||||
table: "delmsgoncmdchannel",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_excludeditem_xpsettings_xpsettingsid",
|
||||
table: "excludeditem",
|
||||
column: "xpsettingsid",
|
||||
principalTable: "xpsettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterchannelid_guildconfigs_guildconfigid",
|
||||
table: "filterchannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filteredword_guildconfigs_guildconfigid",
|
||||
table: "filteredword",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterlinkschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterlinkschannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterwordschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterwordschannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_followedstream_guildconfigs_guildconfigid",
|
||||
table: "followedstream",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_gcchannelid_guildconfigs_guildconfigid",
|
||||
table: "gcchannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_muteduserid_guildconfigs_guildconfigid",
|
||||
table: "muteduserid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_permissions_guildconfigs_guildconfigid",
|
||||
table: "permissions",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_shopentry_guildconfigs_guildconfigid",
|
||||
table: "shopentry",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_shopentryitem_shopentry_shopentryid",
|
||||
table: "shopentryitem",
|
||||
column: "shopentryid",
|
||||
principalTable: "shopentry",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoredrole",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoreduser",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamroleblacklisteduser",
|
||||
column: "streamrolesettingsid",
|
||||
principalTable: "streamrolesettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamrolewhitelisteduser",
|
||||
column: "streamrolesettingsid",
|
||||
principalTable: "streamrolesettings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unbantimer_guildconfigs_guildconfigid",
|
||||
table: "unbantimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unmutetimer_guildconfigs_guildconfigid",
|
||||
table: "unmutetimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unroletimer_guildconfigs_guildconfigid",
|
||||
table: "unroletimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_vcroleinfo_guildconfigs_guildconfigid",
|
||||
table: "vcroleinfo",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antiraidsetting_guildconfigs_guildconfigid",
|
||||
table: "antiraidsetting");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antispamignore_antispamsetting_antispamsettingid",
|
||||
table: "antispamignore");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_antispamsetting_guildconfigs_guildconfigid",
|
||||
table: "antispamsetting");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_commandalias_guildconfigs_guildconfigid",
|
||||
table: "commandalias");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_commandcooldown_guildconfigs_guildconfigid",
|
||||
table: "commandcooldown");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid",
|
||||
table: "delmsgoncmdchannel");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_excludeditem_xpsettings_xpsettingsid",
|
||||
table: "excludeditem");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterchannelid_guildconfigs_guildconfigid",
|
||||
table: "filterchannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filteredword_guildconfigs_guildconfigid",
|
||||
table: "filteredword");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterlinkschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterlinkschannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_filterwordschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterwordschannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_followedstream_guildconfigs_guildconfigid",
|
||||
table: "followedstream");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_gcchannelid_guildconfigs_guildconfigid",
|
||||
table: "gcchannelid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_muteduserid_guildconfigs_guildconfigid",
|
||||
table: "muteduserid");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_permissions_guildconfigs_guildconfigid",
|
||||
table: "permissions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_shopentry_guildconfigs_guildconfigid",
|
||||
table: "shopentry");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_shopentryitem_shopentry_shopentryid",
|
||||
table: "shopentryitem");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoredrole");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoreduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamroleblacklisteduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamrolewhitelisteduser");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unbantimer_guildconfigs_guildconfigid",
|
||||
table: "unbantimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unmutetimer_guildconfigs_guildconfigid",
|
||||
table: "unmutetimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_unroletimer_guildconfigs_guildconfigid",
|
||||
table: "unroletimer");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_vcroleinfo_guildconfigs_guildconfigid",
|
||||
table: "vcroleinfo");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "streamrolesettingsid",
|
||||
table: "streamrolewhitelisteduser",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "streamrolesettingsid",
|
||||
table: "streamroleblacklisteduser",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "guildconfigid",
|
||||
table: "delmsgoncmdchannel",
|
||||
type: "integer",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "integer");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ignoredvoicepresencechannels",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
logsettingid = table.Column<int>(type: "integer", nullable: true),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_ignoredvoicepresencechannels", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_ignoredvoicepresencechannels_logsettings_logsettingid",
|
||||
column: x => x.logsettingid,
|
||||
principalTable: "logsettings",
|
||||
principalColumn: "id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_ignoredvoicepresencechannels_logsettingid",
|
||||
table: "ignoredvoicepresencechannels",
|
||||
column: "logsettingid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antiraidsetting_guildconfigs_guildconfigid",
|
||||
table: "antiraidsetting",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antispamignore_antispamsetting_antispamsettingid",
|
||||
table: "antispamignore",
|
||||
column: "antispamsettingid",
|
||||
principalTable: "antispamsetting",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_antispamsetting_guildconfigs_guildconfigid",
|
||||
table: "antispamsetting",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_commandalias_guildconfigs_guildconfigid",
|
||||
table: "commandalias",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_commandcooldown_guildconfigs_guildconfigid",
|
||||
table: "commandcooldown",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid",
|
||||
table: "delmsgoncmdchannel",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_excludeditem_xpsettings_xpsettingsid",
|
||||
table: "excludeditem",
|
||||
column: "xpsettingsid",
|
||||
principalTable: "xpsettings",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterchannelid_guildconfigs_guildconfigid",
|
||||
table: "filterchannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filteredword_guildconfigs_guildconfigid",
|
||||
table: "filteredword",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterlinkschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterlinkschannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_filterwordschannelid_guildconfigs_guildconfigid",
|
||||
table: "filterwordschannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_followedstream_guildconfigs_guildconfigid",
|
||||
table: "followedstream",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_gcchannelid_guildconfigs_guildconfigid",
|
||||
table: "gcchannelid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_muteduserid_guildconfigs_guildconfigid",
|
||||
table: "muteduserid",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_permissions_guildconfigs_guildconfigid",
|
||||
table: "permissions",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_shopentry_guildconfigs_guildconfigid",
|
||||
table: "shopentry",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_shopentryitem_shopentry_shopentryid",
|
||||
table: "shopentryitem",
|
||||
column: "shopentryid",
|
||||
principalTable: "shopentry",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoredrole",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid",
|
||||
table: "slowmodeignoreduser",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamroleblacklisteduser",
|
||||
column: "streamrolesettingsid",
|
||||
principalTable: "streamrolesettings",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~",
|
||||
table: "streamrolewhitelisteduser",
|
||||
column: "streamrolesettingsid",
|
||||
principalTable: "streamrolesettings",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unbantimer_guildconfigs_guildconfigid",
|
||||
table: "unbantimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unmutetimer_guildconfigs_guildconfigid",
|
||||
table: "unmutetimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_unroletimer_guildconfigs_guildconfigid",
|
||||
table: "unroletimer",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_vcroleinfo_guildconfigs_guildconfigid",
|
||||
table: "vcroleinfo",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,42 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class removepatronlimits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "patronquotas");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "patronquotas",
|
||||
columns: table => new
|
||||
{
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
featuretype = table.Column<int>(type: "integer", nullable: false),
|
||||
feature = table.Column<string>(type: "text", nullable: false),
|
||||
dailycount = table.Column<long>(type: "bigint", nullable: false),
|
||||
hourlycount = table.Column<long>(type: "bigint", nullable: false),
|
||||
monthlycount = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_patronquotas_userid",
|
||||
table: "patronquotas",
|
||||
column: "userid");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,33 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class honeypot : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "honeypotchannels",
|
||||
columns: table => new
|
||||
{
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_honeypotchannels", x => x.guildid);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "honeypotchannels");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,199 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class greetsettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "greetsettings",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy",
|
||||
NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
greettype = table.Column<int>(type: "integer", nullable: false),
|
||||
messagetext = table.Column<string>(type: "text", nullable: true),
|
||||
isenabled = table.Column<bool>(type: "boolean", nullable: false, defaultValue: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: true),
|
||||
autodeletetimer = table.Column<int>(type: "integer", nullable: false, defaultValue: 0)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_greetsettings", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_greetsettings_guildid_greettype",
|
||||
table: "greetsettings",
|
||||
columns: new[] { "guildid", "greettype" },
|
||||
unique: true);
|
||||
|
||||
MigrationQueries.GreetSettingsCopy(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "autodeletebyemessagestimer",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "autodeletegreetmessagestimer",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "boostmessage",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "boostmessagechannelid",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "boostmessagedeleteafter",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "byemessagechannelid",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "channelbyemessagetext",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "channelgreetmessagetext",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "dmgreetmessagetext",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "greetmessagechannelid",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "sendboostmessage",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "sendchannelbyemessage",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "sendchannelgreetmessage",
|
||||
table: "guildconfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "senddmgreetmessage",
|
||||
table: "guildconfigs");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "greetsettings");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "autodeletebyemessagestimer",
|
||||
table: "guildconfigs",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "autodeletegreetmessagestimer",
|
||||
table: "guildconfigs",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "boostmessage",
|
||||
table: "guildconfigs",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "boostmessagechannelid",
|
||||
table: "guildconfigs",
|
||||
type: "numeric(20,0)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "boostmessagedeleteafter",
|
||||
table: "guildconfigs",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "byemessagechannelid",
|
||||
table: "guildconfigs",
|
||||
type: "numeric(20,0)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "channelbyemessagetext",
|
||||
table: "guildconfigs",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "channelgreetmessagetext",
|
||||
table: "guildconfigs",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "dmgreetmessagetext",
|
||||
table: "guildconfigs",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "greetmessagechannelid",
|
||||
table: "guildconfigs",
|
||||
type: "numeric(20,0)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "sendboostmessage",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "sendchannelbyemessage",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "sendchannelgreetmessage",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "senddmgreetmessage",
|
||||
table: "guildconfigs",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,71 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class warnsplit : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<decimal>(
|
||||
name: "guildid",
|
||||
table: "warningpunishment",
|
||||
type: "numeric(20,0)",
|
||||
nullable: false,
|
||||
defaultValue: 0m);
|
||||
|
||||
MigrationQueries.AddGuildIdsToWarningPunishment(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_warningpunishment_guildconfigid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "guildconfigid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.AddUniqueConstraint(
|
||||
name: "ak_warningpunishment_guildid_count",
|
||||
table: "warningpunishment",
|
||||
columns: new[] { "guildid", "count" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropUniqueConstraint(
|
||||
name: "ak_warningpunishment_guildid_count",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "guildid",
|
||||
table: "warningpunishment");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "guildconfigid",
|
||||
table: "warningpunishment",
|
||||
type: "integer",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_warningpunishment_guildconfigid",
|
||||
table: "warningpunishment",
|
||||
column: "guildconfigid");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_warningpunishment_guildconfigs_guildconfigid",
|
||||
table: "warningpunishment",
|
||||
column: "guildconfigid",
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,54 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ncanvas : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ncpixel",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
position = table.Column<int>(type: "integer", nullable: false),
|
||||
price = table.Column<long>(type: "bigint", nullable: false),
|
||||
ownerid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
color = table.Column<long>(type: "bigint", nullable: false),
|
||||
text = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_ncpixel", x => x.id);
|
||||
table.UniqueConstraint("ak_ncpixel_position", x => x.position);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_discorduser_username",
|
||||
table: "discorduser",
|
||||
column: "username");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_ncpixel_ownerid",
|
||||
table: "ncpixel",
|
||||
column: "ownerid");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ncpixel");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_discorduser_username",
|
||||
table: "discorduser");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,54 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class nodiscrimandflagtranslate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "discriminator",
|
||||
table: "discorduser");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "flagtranslatechannel",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_flagtranslatechannel", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_flagtranslatechannel_guildid_channelid",
|
||||
table: "flagtranslatechannel",
|
||||
columns: new[] { "guildid", "channelid" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "flagtranslatechannel");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "discriminator",
|
||||
table: "discorduser",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,48 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class betstats : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "userbetstats",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
game = table.Column<int>(type: "integer", nullable: false),
|
||||
wincount = table.Column<long>(type: "bigint", nullable: false),
|
||||
losecount = table.Column<long>(type: "bigint", nullable: false),
|
||||
totalbet = table.Column<decimal>(type: "numeric", nullable: false),
|
||||
paidout = table.Column<decimal>(type: "numeric", nullable: false),
|
||||
maxwin = table.Column<long>(type: "bigint", nullable: false),
|
||||
maxbet = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_userbetstats", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_userbetstats_userid_game",
|
||||
table: "userbetstats",
|
||||
columns: new[] { "userid", "game" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "userbetstats");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,33 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class rakeback : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "rakeback",
|
||||
columns: table => new
|
||||
{
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
amount = table.Column<decimal>(type: "numeric", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_rakeback", x => x.userid);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "rakeback");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,74 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class btnroles_guildcolors : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "buttonrole",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
buttonid = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
messageid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
position = table.Column<int>(type: "integer", nullable: false),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
emote = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
label = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: false),
|
||||
exclusive = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_buttonrole", x => x.id);
|
||||
table.UniqueConstraint("ak_buttonrole_roleid_messageid", x => new { x.roleid, x.messageid });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "guildcolors",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
okcolor = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true),
|
||||
errorcolor = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true),
|
||||
pendingcolor = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_guildcolors", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_buttonrole_guildid",
|
||||
table: "buttonrole",
|
||||
column: "guildid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_guildcolors_guildid",
|
||||
table: "guildcolors",
|
||||
column: "guildid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "buttonrole");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "guildcolors");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,153 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class sarrework : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "groupname");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "selfassignableroles");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "sarautodelete",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
isenabled = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_sarautodelete", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "sargroup",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
groupnumber = table.Column<int>(type: "integer", nullable: false),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
rolereq = table.Column<decimal>(type: "numeric(20,0)", nullable: true),
|
||||
isexclusive = table.Column<bool>(type: "boolean", nullable: false),
|
||||
name = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_sargroup", x => x.id);
|
||||
table.UniqueConstraint("ak_sargroup_guildid_groupnumber", x => new { x.guildid, x.groupnumber });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "sar",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
sargroupid = table.Column<int>(type: "integer", nullable: false),
|
||||
levelreq = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_sar", x => x.id);
|
||||
table.UniqueConstraint("ak_sar_guildid_roleid", x => new { x.guildid, x.roleid });
|
||||
table.ForeignKey(
|
||||
name: "fk_sar_sargroup_sargroupid",
|
||||
column: x => x.sargroupid,
|
||||
principalTable: "sargroup",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_sar_sargroupid",
|
||||
table: "sar",
|
||||
column: "sargroupid");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_sarautodelete_guildid",
|
||||
table: "sarautodelete",
|
||||
column: "guildid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "sar");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "sarautodelete");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "sargroup");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "groupname",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildconfigid = table.Column<int>(type: "integer", nullable: false),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
name = table.Column<string>(type: "text", nullable: true),
|
||||
number = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_groupname", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_groupname_guildconfigs_guildconfigid",
|
||||
column: x => x.guildconfigid,
|
||||
principalTable: "guildconfigs",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "selfassignableroles",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
dateadded = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
|
||||
group = table.Column<int>(type: "integer", nullable: false, defaultValue: 0),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
levelrequirement = table.Column<int>(type: "integer", nullable: false),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_selfassignableroles", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_groupname_guildconfigid_number",
|
||||
table: "groupname",
|
||||
columns: new[] { "guildconfigid", "number" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_selfassignableroles_guildid_roleid",
|
||||
table: "selfassignableroles",
|
||||
columns: new[] { "guildid", "roleid" },
|
||||
unique: true);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
using System;
|
||||
using EllieBot.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class awardedxptemprolenotify : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_userxpstats_awardedxp",
|
||||
table: "userxpstats");
|
||||
|
||||
MigrationQueries.MergeAwardedXp(migrationBuilder);
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "awardedxp",
|
||||
table: "userxpstats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "notifyonlevelup",
|
||||
table: "userxpstats");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "notify",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
channelid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
type = table.Column<int>(type: "integer", nullable: false),
|
||||
message = table.Column<string>(type: "character varying(10000)", maxLength: 10000, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_notify", x => x.id);
|
||||
table.UniqueConstraint("ak_notify_guildid_type", x => new { x.guildid, x.type });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "temprole",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
guildid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
remove = table.Column<bool>(type: "boolean", nullable: false),
|
||||
roleid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
expiresat = table.Column<DateTime>(type: "timestamp without time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_temprole", x => x.id);
|
||||
table.UniqueConstraint("ak_temprole_guildid_userid_roleid", x => new { x.guildid, x.userid, x.roleid });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_userbetstats_maxwin",
|
||||
table: "userbetstats",
|
||||
column: "maxwin");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_temprole_expiresat",
|
||||
table: "temprole",
|
||||
column: "expiresat");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "notify");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "temprole");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_userbetstats_maxwin",
|
||||
table: "userbetstats");
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "awardedxp",
|
||||
table: "userxpstats",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "notifyonlevelup",
|
||||
table: "userxpstats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_userxpstats_awardedxp",
|
||||
table: "userxpstats",
|
||||
column: "awardedxp");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,39 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class fishes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "fishcatch",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
fishid = table.Column<int>(type: "integer", nullable: false),
|
||||
count = table.Column<int>(type: "integer", nullable: false),
|
||||
maxstars = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_fishcatch", x => x.id);
|
||||
table.UniqueConstraint("ak_fishcatch_userid_fishid", x => new { x.userid, x.fishid });
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "fishcatch");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,42 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class fishskill : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "userfishstats",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
userid = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
|
||||
skill = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_userfishstats", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_userfishstats_userid",
|
||||
table: "userfishstats",
|
||||
column: "userid",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "userfishstats");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,15 +12,15 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace EllieBot.Migrations.PostgreSql
|
||||
{
|
||||
[DbContext(typeof(PostgreSqlContext))]
|
||||
[Migration("20241207150050_awardedxp-temprole-notify")]
|
||||
partial class awardedxptemprolenotify
|
||||
[Migration("20250123191330_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "8.0.8")
|
||||
.HasAnnotation("ProductVersion", "9.0.1")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
@ -1319,10 +1319,6 @@ namespace EllieBot.Migrations.PostgreSql
|
|||
.HasColumnType("text")
|
||||
.HasColumnName("autoassignroleids");
|
||||
|
||||
b.Property<bool>("AutoDeleteSelfAssignedRoleMessages")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("autodeleteselfassignedrolemessages");
|
||||
|
||||
b.Property<bool>("CleverbotEnabled")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("cleverbotenabled");
|
||||
|
@ -1343,10 +1339,6 @@ namespace EllieBot.Migrations.PostgreSql
|
|||
.HasColumnType("boolean")
|
||||
.HasColumnName("disableglobalexpressions");
|
||||
|
||||
b.Property<bool>("ExclusiveSelfAssignedRoles")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("exclusiveselfassignedroles");
|
||||
|
||||
b.Property<bool>("FilterInvites")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("filterinvites");
|
||||
|
@ -1391,6 +1383,10 @@ namespace EllieBot.Migrations.PostgreSql
|
|||
.HasColumnType("boolean")
|
||||
.HasColumnName("stickyroles");
|
||||
|
||||
b.Property<string>("TestMigration")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("testmigration");
|
||||
|
||||
b.Property<string>("TimeZoneId")
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("timezoneid");
|
||||
|
@ -3377,6 +3373,67 @@ namespace EllieBot.Migrations.PostgreSql
|
|||
b.ToTable("xpshopowneditem", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("EllieBot.Modules.Games.FishCatch", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("Count")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("count");
|
||||
|
||||
b.Property<int>("FishId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("fishid");
|
||||
|
||||
b.Property<int>("MaxStars")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("maxstars");
|
||||
|
||||
b.Property<decimal>("UserId")
|
||||
.HasColumnType("numeric(20,0)")
|
||||
.HasColumnName("userid");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_fishcatch");
|
||||
|
||||
b.HasAlternateKey("UserId", "FishId")
|
||||
.HasName("ak_fishcatch_userid_fishid");
|
||||
|
||||
b.ToTable("fishcatch", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("EllieBot.Modules.Games.UserFishStats", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("Skill")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("skill");
|
||||
|
||||
b.Property<decimal>("UserId")
|
||||
.HasColumnType("numeric(20,0)")
|
||||
.HasColumnName("userid");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_userfishstats");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_userfishstats_userid");
|
||||
|
||||
b.ToTable("userfishstats", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("EllieBot.Services.GreetSettings", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,493 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class cleanup : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_GuildConfigs_Permission_RootPermissionId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.Sql("UPDATE Permission SET NextId = NULL;");
|
||||
|
||||
migrationBuilder.Sql("DELETE FROM FilteredWord WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
|
||||
migrationBuilder.Sql("DELETE FROM FilterChannelId WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
|
||||
migrationBuilder.Sql("DELETE FROM CommandCooldown WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)");
|
||||
|
||||
// fix for users who edited their waifuinfo table manually and are unable to update
|
||||
migrationBuilder.Sql("DELETE FROM WaifuInfo where WaifuId not in (SELECT Id from DiscordUser);");
|
||||
|
||||
// fix for users who deleted clubs manually and are unable to update now
|
||||
migrationBuilder.Sql("UPDATE DiscordUser SET ClubId = null WHERE ClubId is not null and ClubId not in (SELECT Id from Clubs);");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChannelCreated",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChannelDestroyed",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChannelId",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ChannelUpdated",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsLogging",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogUserPresence",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogVoicePresence",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MessageDeleted",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MessageUpdated",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserBanned",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserJoined",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserLeft",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserPresenceChannelId",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserUnbanned",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UserUpdated",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VoicePresenceChannelId",
|
||||
table: "LogSettings");
|
||||
|
||||
// FUTURE cleanup guildconfigs which have logsettings id set to null
|
||||
migrationBuilder.Sql("UPDATE GuildConfigs SET LogSettingId = null WHERE LogSettingId NOT IN (SELECT Id from LogSettings)");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Permission");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Stakes");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GuildConfigs_RootPermissionId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "NotifyMessage",
|
||||
table: "XpSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "XpRoleRewardExclusive",
|
||||
table: "XpSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Item",
|
||||
table: "WaifuItem");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Price",
|
||||
table: "WaifuItem");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UseCount",
|
||||
table: "Quotes");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AutoAssignRoleId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AutoDcFromVc",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DefaultMusicVolume",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "RootPermissionId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "VoicePlusTextEnabled",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsRegex",
|
||||
table: "CustomReactions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OwnerOnly",
|
||||
table: "CustomReactions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "UseCount",
|
||||
table: "CustomReactions");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "NotifyOnLevelUp",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastXpGain",
|
||||
table: "DiscordUser",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValueSql: "datetime('now', '-1 years')",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastLevelUp",
|
||||
table: "DiscordUser",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValueSql: "datetime('now')",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT",
|
||||
oldDefaultValue: new DateTime(2017, 9, 21, 20, 53, 13, 305, DateTimeKind.Local));
|
||||
|
||||
migrationBuilder.AlterColumn<bool>(
|
||||
name: "IsClubAdmin",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false,
|
||||
oldClrType: typeof(bool),
|
||||
oldType: "INTEGER");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "NotifyMessage",
|
||||
table: "XpSettings",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "XpRoleRewardExclusive",
|
||||
table: "XpSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Item",
|
||||
table: "WaifuItem",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Price",
|
||||
table: "WaifuItem",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "UseCount",
|
||||
table: "Quotes",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ChannelCreated",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ChannelDestroyed",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "ChannelId",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "ChannelUpdated",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsLogging",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "LogUserPresence",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "LogVoicePresence",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MessageDeleted",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "MessageUpdated",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UserBanned",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UserJoined",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UserLeft",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "UserPresenceChannelId",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UserUnbanned",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "UserUpdated",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "VoicePresenceChannelId",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "AutoAssignRoleId",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AutoDcFromVc",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<float>(
|
||||
name: "DefaultMusicVolume",
|
||||
table: "GuildConfigs",
|
||||
type: "REAL",
|
||||
nullable: false,
|
||||
defaultValue: 0f);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "RootPermissionId",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "VoicePlusTextEnabled",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "NotifyOnLevelUp",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: 0);
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastXpGain",
|
||||
table: "DiscordUser",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT",
|
||||
oldDefaultValueSql: "datetime('now', '-1 years')");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastLevelUp",
|
||||
table: "DiscordUser",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(2017, 9, 21, 20, 53, 13, 305, DateTimeKind.Local),
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT",
|
||||
oldDefaultValueSql: "datetime('now')");
|
||||
|
||||
migrationBuilder.AlterColumn<bool>(
|
||||
name: "IsClubAdmin",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(bool),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsRegex",
|
||||
table: "CustomReactions",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "OwnerOnly",
|
||||
table: "CustomReactions",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "UseCount",
|
||||
table: "CustomReactions",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Permission",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
NextId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
PrimaryTarget = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
PrimaryTargetId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
SecondaryTarget = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
SecondaryTargetName = table.Column<string>(type: "TEXT", nullable: true),
|
||||
State = table.Column<bool>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Permission", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Permission_Permission_NextId",
|
||||
column: x => x.NextId,
|
||||
principalTable: "Permission",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Stakes",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
Amount = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
Source = table.Column<string>(type: "TEXT", nullable: true),
|
||||
UserId = table.Column<ulong>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Stakes", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GuildConfigs_RootPermissionId",
|
||||
table: "GuildConfigs",
|
||||
column: "RootPermissionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Permission_NextId",
|
||||
table: "Permission",
|
||||
column: "NextId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_GuildConfigs_Permission_RootPermissionId",
|
||||
table: "GuildConfigs",
|
||||
column: "RootPermissionId",
|
||||
principalTable: "Permission",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,37 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class rerocascade : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ReactionRole_ReactionRoleMessage_ReactionRoleMessageId",
|
||||
table: "ReactionRole");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ReactionRole_ReactionRoleMessage_ReactionRoleMessageId",
|
||||
table: "ReactionRole",
|
||||
column: "ReactionRoleMessageId",
|
||||
principalTable: "ReactionRoleMessage",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_ReactionRole_ReactionRoleMessage_ReactionRoleMessageId",
|
||||
table: "ReactionRole");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_ReactionRole_ReactionRoleMessage_ReactionRoleMessageId",
|
||||
table: "ReactionRole",
|
||||
column: "ReactionRoleMessageId",
|
||||
principalTable: "ReactionRoleMessage",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,56 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class boostmessages : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "BoostMessage",
|
||||
table: "GuildConfigs",
|
||||
type: "TEXT",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "BoostMessageChannelId",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "BoostMessageDeleteAfter",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SendBoostMessage",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BoostMessage",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BoostMessageChannelId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BoostMessageDeleteAfter",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SendBoostMessage",
|
||||
table: "GuildConfigs");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,69 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class logsettingsindependence : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "GuildId",
|
||||
table: "LogSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0ul);
|
||||
|
||||
migrationBuilder.Sql(
|
||||
@"UPDATE LogSettings SET GuildId = (SELECT GuildId FROM GuildConfigs WHERE LogSettingId = LogSettings.Id);
|
||||
DELETE FROM LogSettings WHERE GuildId = 0;");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_GuildConfigs_LogSettings_LogSettingId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_GuildConfigs_LogSettingId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LogSettingId",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_LogSettings_GuildId",
|
||||
table: "LogSettings",
|
||||
column: "GuildId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_LogSettings_GuildId",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GuildId",
|
||||
table: "LogSettings");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "LogSettingId",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GuildConfigs_LogSettingId",
|
||||
table: "GuildConfigs",
|
||||
column: "LogSettingId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_GuildConfigs_LogSettings_LogSettingId",
|
||||
table: "GuildConfigs",
|
||||
column: "LogSettingId",
|
||||
principalTable: "LogSettings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,37 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class imageonlychannels : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ImageOnlyChannels",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GuildId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
ChannelId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ImageOnlyChannels", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ImageOnlyChannels_ChannelId",
|
||||
table: "ImageOnlyChannels",
|
||||
column: "ChannelId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ImageOnlyChannels");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,97 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class logignoreuserchannel : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql("DELETE FROM IgnoredLogChannels WHERE LogSettingId is NULL");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
|
||||
table: "IgnoredLogChannels");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IgnoredLogChannels_LogSettingId",
|
||||
table: "IgnoredLogChannels");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "ChannelId",
|
||||
table: "IgnoredLogChannels",
|
||||
newName: "LogItemId");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "LogSettingId",
|
||||
table: "IgnoredLogChannels",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ItemType",
|
||||
table: "IgnoredLogChannels",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IgnoredLogChannels_LogSettingId_LogItemId_ItemType",
|
||||
table: "IgnoredLogChannels",
|
||||
columns: new[] { "LogSettingId", "LogItemId", "ItemType" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
|
||||
table: "IgnoredLogChannels",
|
||||
column: "LogSettingId",
|
||||
principalTable: "LogSettings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
|
||||
table: "IgnoredLogChannels");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IgnoredLogChannels_LogSettingId_LogItemId_ItemType",
|
||||
table: "IgnoredLogChannels");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ItemType",
|
||||
table: "IgnoredLogChannels");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "LogItemId",
|
||||
table: "IgnoredLogChannels",
|
||||
newName: "ChannelId");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "LogSettingId",
|
||||
table: "IgnoredLogChannels",
|
||||
type: "INTEGER",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IgnoredLogChannels_LogSettingId",
|
||||
table: "IgnoredLogChannels",
|
||||
column: "LogSettingId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IgnoredLogChannels_LogSettings_LogSettingId",
|
||||
table: "IgnoredLogChannels",
|
||||
column: "LogSettingId",
|
||||
principalTable: "LogSettings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,75 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class nsfwblacklisttags : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "NsfwBlacklistedTags",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GuildId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
Tag = table.Column<string>(type: "TEXT", nullable: true),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_NsfwBlacklistedTags", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NsfwBlacklistedTags_GuildId",
|
||||
table: "NsfwBlacklistedTags",
|
||||
column: "GuildId");
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO NsfwBlacklistedTags(Id, GuildId, Tag, DateAdded)
|
||||
SELECT
|
||||
Id,
|
||||
(SELECT GuildId From GuildConfigs WHERE Id=GuildConfigId),
|
||||
Tag,
|
||||
DateAdded
|
||||
FROM NsfwBlacklitedTag
|
||||
WHERE GuildConfigId in (SELECT Id from GuildConfigs);");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "NsfwBlacklitedTag");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "NsfwBlacklistedTags");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "NsfwBlacklitedTag",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
GuildConfigId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
Tag = table.Column<string>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_NsfwBlacklitedTag", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_NsfwBlacklitedTag_GuildConfigs_GuildConfigId",
|
||||
column: x => x.GuildConfigId,
|
||||
principalTable: "GuildConfigs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_NsfwBlacklitedTag_GuildConfigId",
|
||||
table: "NsfwBlacklitedTag",
|
||||
column: "GuildConfigId");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,24 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class weightedwarnings : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Weight",
|
||||
table: "Warnings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 1);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Weight",
|
||||
table: "Warnings");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,70 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class atlrework : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AutoTranslateChannels",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GuildId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
ChannelId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
AutoDelete = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AutoTranslateChannels", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AutoTranslateUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ChannelId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
UserId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
Source = table.Column<string>(type: "TEXT", nullable: true),
|
||||
Target = table.Column<string>(type: "TEXT", nullable: true),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AutoTranslateUsers", x => x.Id);
|
||||
table.UniqueConstraint("AK_AutoTranslateUsers_ChannelId_UserId", x => new { x.ChannelId, x.UserId });
|
||||
table.ForeignKey(
|
||||
name: "FK_AutoTranslateUsers_AutoTranslateChannels_ChannelId",
|
||||
column: x => x.ChannelId,
|
||||
principalTable: "AutoTranslateChannels",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AutoTranslateChannels_ChannelId",
|
||||
table: "AutoTranslateChannels",
|
||||
column: "ChannelId",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AutoTranslateChannels_GuildId",
|
||||
table: "AutoTranslateChannels",
|
||||
column: "GuildId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AutoTranslateUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AutoTranslateChannels");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,118 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class crsrenametoexpressionspermrename : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Permissionv2_GuildConfigs_GuildConfigId",
|
||||
table: "Permissionv2");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Permissionv2",
|
||||
table: "Permissionv2");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_CustomReactions",
|
||||
table: "CustomReactions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Permissionv2",
|
||||
newName: "Permissions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "CustomReactions",
|
||||
newName: "Expressions");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Permissionv2_GuildConfigId",
|
||||
table: "Permissions",
|
||||
newName: "IX_Permissions_GuildConfigId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Permissions",
|
||||
table: "Permissions",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Expressions",
|
||||
table: "Expressions",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Permissions_GuildConfigs_GuildConfigId",
|
||||
table: "Permissions",
|
||||
column: "GuildConfigId",
|
||||
principalTable: "GuildConfigs",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE Permissions
|
||||
SET SecondaryTargetName='ACTUALEXPRESSIONS'
|
||||
WHERE SecondaryTargetName='ActualCustomReactions' COLLATE NOCASE;");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE Permissions
|
||||
SET SecondaryTargetName='EXPRESSIONS'
|
||||
WHERE SecondaryTargetName='CustomReactions' COLLATE NOCASE;");
|
||||
|
||||
migrationBuilder.Sql(@"UPDATE Permissions
|
||||
SET SecondaryTargetName= case lower(SecondaryTargetName)
|
||||
WHEN 'editcustreact' THEN 'expredit'
|
||||
WHEN 'delcustreact' THEN 'exprdel'
|
||||
WHEN 'listcustreact' THEN 'exprlist'
|
||||
WHEN 'addcustreact' THEN 'expradd'
|
||||
WHEN 'showcustreact' THEN 'exprshow'
|
||||
ELSE SecondaryTargetName
|
||||
END
|
||||
WHERE lower(SecondaryTargetName) in ('editcustreact', 'delcustreact', 'listcustreact', 'addcustreact', 'showcustreact');");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Permissions_GuildConfigs_GuildConfigId",
|
||||
table: "Permissions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Permissions",
|
||||
table: "Permissions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_Expressions",
|
||||
table: "Expressions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Permissions",
|
||||
newName: "Permissionv2");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "Expressions",
|
||||
newName: "CustomReactions");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_Permissions_GuildConfigId",
|
||||
table: "Permissionv2",
|
||||
newName: "IX_Permissionv2_GuildConfigId");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_Permissionv2",
|
||||
table: "Permissionv2",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_CustomReactions",
|
||||
table: "CustomReactions",
|
||||
column: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Permissionv2_GuildConfigs_GuildConfigId",
|
||||
table: "Permissionv2",
|
||||
column: "GuildConfigId",
|
||||
principalTable: "GuildConfigs",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,81 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class filtersettingscleanup : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_FilterChannelId_GuildConfigs_GuildConfigId1",
|
||||
table: "FilterChannelId");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_FilterChannelId_GuildConfigId1",
|
||||
table: "FilterChannelId");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "FilterWordsChannelId",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ChannelId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
GuildConfigId = table.Column<int>(type: "INTEGER", nullable: true),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_FilterWordsChannelId", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_FilterWordsChannelId_GuildConfigs_GuildConfigId",
|
||||
column: x => x.GuildConfigId,
|
||||
principalTable: "GuildConfigs",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FilterWordsChannelId_GuildConfigId",
|
||||
table: "FilterWordsChannelId",
|
||||
column: "GuildConfigId");
|
||||
|
||||
migrationBuilder.Sql(@"INSERT INTO FilterWordsChannelId(Id, ChannelId, GuildConfigId, DateAdded)
|
||||
SELECT Id, ChannelId, GuildConfigId1, DateAdded
|
||||
FROM FilterChannelId
|
||||
WHERE GuildConfigId1 is not null;
|
||||
-- Remove them after moving them to a different table
|
||||
DELETE FROM FilterChannelId
|
||||
WHERE GuildConfigId is null;");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GuildConfigId1",
|
||||
table: "FilterChannelId");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "FilterWordsChannelId");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "GuildConfigId1",
|
||||
table: "FilterChannelId",
|
||||
type: "INTEGER",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_FilterChannelId_GuildConfigId1",
|
||||
table: "FilterChannelId",
|
||||
column: "GuildConfigId1");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_FilterChannelId_GuildConfigs_GuildConfigId1",
|
||||
table: "FilterChannelId",
|
||||
column: "GuildConfigId1",
|
||||
principalTable: "GuildConfigs",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,94 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class curtrsreworkdiscorduserdefaults : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Reason",
|
||||
table: "CurrencyTransactions",
|
||||
newName: "Note");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "TotalXp",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "CurrencyAmount",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0L,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Extra",
|
||||
table: "CurrencyTransactions",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<ulong>(
|
||||
name: "OtherId",
|
||||
table: "CurrencyTransactions",
|
||||
type: "INTEGER",
|
||||
nullable: true,
|
||||
defaultValueSql: "NULL");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Type",
|
||||
table: "CurrencyTransactions",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Extra",
|
||||
table: "CurrencyTransactions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "OtherId",
|
||||
table: "CurrencyTransactions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Type",
|
||||
table: "CurrencyTransactions");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Note",
|
||||
table: "CurrencyTransactions",
|
||||
newName: "Reason");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "TotalXp",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: 0);
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "CurrencyAmount",
|
||||
table: "DiscordUser",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: 0L);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,69 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class musicautoplay : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
// these 2 settings weren't being used for a long time
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AutoDeleteByeMessages",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AutoDeleteGreetMessages",
|
||||
table: "GuildConfigs");
|
||||
|
||||
migrationBuilder.AlterColumn<long>(
|
||||
name: "Weight",
|
||||
table: "Warnings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 1L,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: 1);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AutoPlay",
|
||||
table: "MusicPlayerSettings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "AutoPlay",
|
||||
table: "MusicPlayerSettings");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Weight",
|
||||
table: "Warnings",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 1,
|
||||
oldClrType: typeof(long),
|
||||
oldType: "INTEGER",
|
||||
oldDefaultValue: 1L);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AutoDeleteByeMessages",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "AutoDeleteGreetMessages",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,131 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class clubsrefactor : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"UPDATE Clubs
|
||||
SET Name = Name || '#' || Discrim
|
||||
WHERE Discrim <> 1;
|
||||
|
||||
UPDATE Clubs as co
|
||||
SET Name =
|
||||
CASE (select count(*) from Clubs as ci where co.Name == ci.Name) = 1
|
||||
WHEN true
|
||||
THEN Name
|
||||
ELSE
|
||||
Name || '#' || Discrim
|
||||
END
|
||||
WHERE Discrim = 1;");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Clubs_DiscordUser_OwnerId",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.DropUniqueConstraint(
|
||||
name: "AK_Clubs_Name_Discrim",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Discrim",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MinimumLevelReq",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastLevelUp",
|
||||
table: "UserXpStats",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValueSql: "datetime('now')",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT",
|
||||
oldDefaultValue: new DateTime(2017, 9, 21, 20, 53, 13, 307, DateTimeKind.Local));
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "OwnerId",
|
||||
table: "Clubs",
|
||||
type: "INTEGER",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER");
|
||||
|
||||
migrationBuilder.AddUniqueConstraint(
|
||||
name: "AK_Clubs_Name",
|
||||
table: "Clubs",
|
||||
column: "Name");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Clubs_DiscordUser_OwnerId",
|
||||
table: "Clubs",
|
||||
column: "OwnerId",
|
||||
principalTable: "DiscordUser",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Clubs_DiscordUser_OwnerId",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.DropUniqueConstraint(
|
||||
name: "AK_Clubs_Name",
|
||||
table: "Clubs");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LastLevelUp",
|
||||
table: "UserXpStats",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(2017, 9, 21, 20, 53, 13, 307, DateTimeKind.Local),
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "TEXT",
|
||||
oldDefaultValueSql: "datetime('now')");
|
||||
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "OwnerId",
|
||||
table: "Clubs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "INTEGER",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Discrim",
|
||||
table: "Clubs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MinimumLevelReq",
|
||||
table: "Clubs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddUniqueConstraint(
|
||||
name: "AK_Clubs_Name_Discrim",
|
||||
table: "Clubs",
|
||||
columns: new[] { "Name", "Discrim" });
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Clubs_DiscordUser_OwnerId",
|
||||
table: "Clubs",
|
||||
column: "OwnerId",
|
||||
principalTable: "DiscordUser",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,26 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class stondel : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "DeleteStreamOnlineMessage",
|
||||
table: "GuildConfigs",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DeleteStreamOnlineMessage",
|
||||
table: "GuildConfigs");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -1,39 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace EllieBot.Migrations
|
||||
{
|
||||
public partial class bank : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "BankUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
UserId = table.Column<ulong>(type: "INTEGER", nullable: false),
|
||||
Balance = table.Column<long>(type: "INTEGER", nullable: false),
|
||||
DateAdded = table.Column<DateTime>(type: "TEXT", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_BankUsers", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_BankUsers_UserId",
|
||||
table: "BankUsers",
|
||||
column: "UserId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "BankUsers");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue