WIP db provider support for Mysql and Postgres

This commit is contained in:
Kwoth
2022-04-11 10:41:26 +00:00
parent 8e1ec2ed9e
commit e23233ee06
66 changed files with 21891 additions and 382 deletions

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210621042359_squash")]
partial class squash
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210707002343_cleanup")]
partial class cleanup
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210911225622_rero-cascade")]
partial class rerocascade
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210912182515_boost-messages")]
partial class boostmessages
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210912200106_logsettings-independence")]
partial class logsettingsindependence
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210914180026_image-only-channels")]
partial class imageonlychannels
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20210921204645_logignore-user-channel")]
partial class logignoreuserchannel
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20211015232708_nsfw-blacklist-tags")]
partial class nsfwblacklisttags
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20211121002508_weighted-warnings")]
partial class weightedwarnings
{

View File

@@ -8,7 +8,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20211213145407_atl-rework")]
partial class atlrework
{

View File

@@ -10,7 +10,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20220102102344_crs-rename-to-expressions-perm-rename")]
partial class crsrenametoexpressionspermrename
{

View File

@@ -10,7 +10,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20220110105942_filter-settings-cleanup")]
partial class filtersettingscleanup
{

View File

@@ -10,7 +10,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20220125044401_curtrs-rework-discorduser-defaults")]
partial class curtrsreworkdiscorduserdefaults
{

View File

@@ -10,7 +10,7 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
[DbContext(typeof(SqliteContext))]
[Migration("20220213123633_music-autoplay")]
partial class musicautoplay
{

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,132 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NadekoBot.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);
}
}
}

View File

@@ -9,13 +9,13 @@ using NadekoBot.Services.Database;
namespace NadekoBot.Migrations
{
[DbContext(typeof(NadekoContext))]
partial class NadekoContextModelSnapshot : ModelSnapshot
[DbContext(typeof(SqliteContext))]
partial class NadekoSqliteContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "6.0.2");
modelBuilder.HasAnnotation("ProductVersion", "6.0.3");
modelBuilder.Entity("NadekoBot.Db.Models.ClubApplicants", b =>
{
@@ -29,7 +29,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("ClubApplicants", (string)null);
b.ToTable("ClubApplicants");
});
modelBuilder.Entity("NadekoBot.Db.Models.ClubBans", b =>
@@ -44,7 +44,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("ClubBans", (string)null);
b.ToTable("ClubBans");
});
modelBuilder.Entity("NadekoBot.Db.Models.ClubInfo", b =>
@@ -59,21 +59,15 @@ namespace NadekoBot.Migrations
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<int>("Discrim")
.HasColumnType("INTEGER");
b.Property<string>("ImageUrl")
.HasColumnType("TEXT");
b.Property<int>("MinimumLevelReq")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT");
b.Property<int>("OwnerId")
b.Property<int?>("OwnerId")
.HasColumnType("INTEGER");
b.Property<int>("Xp")
@@ -81,12 +75,12 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.HasAlternateKey("Name", "Discrim");
b.HasAlternateKey("Name");
b.HasIndex("OwnerId")
.IsUnique();
b.ToTable("Clubs", (string)null);
b.ToTable("Clubs");
});
modelBuilder.Entity("NadekoBot.Db.Models.DiscordUser", b =>
@@ -155,7 +149,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("DiscordUser", (string)null);
b.ToTable("DiscordUser");
});
modelBuilder.Entity("NadekoBot.Db.Models.FollowedStream", b =>
@@ -189,7 +183,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("FollowedStream", (string)null);
b.ToTable("FollowedStream");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiAltSetting", b =>
@@ -218,7 +212,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId")
.IsUnique();
b.ToTable("AntiAltSetting", (string)null);
b.ToTable("AntiAltSetting");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiRaidSetting", b =>
@@ -250,7 +244,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId")
.IsUnique();
b.ToTable("AntiRaidSetting", (string)null);
b.ToTable("AntiRaidSetting");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamIgnore", b =>
@@ -272,7 +266,7 @@ namespace NadekoBot.Migrations
b.HasIndex("AntiSpamSettingId");
b.ToTable("AntiSpamIgnore", (string)null);
b.ToTable("AntiSpamIgnore");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamSetting", b =>
@@ -304,7 +298,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId")
.IsUnique();
b.ToTable("AntiSpamSetting", (string)null);
b.ToTable("AntiSpamSetting");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AutoCommand", b =>
@@ -342,7 +336,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("AutoCommands", (string)null);
b.ToTable("AutoCommands");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AutoTranslateChannel", b =>
@@ -370,7 +364,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId");
b.ToTable("AutoTranslateChannels", (string)null);
b.ToTable("AutoTranslateChannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AutoTranslateUser", b =>
@@ -398,7 +392,7 @@ namespace NadekoBot.Migrations
b.HasAlternateKey("ChannelId", "UserId");
b.ToTable("AutoTranslateUsers", (string)null);
b.ToTable("AutoTranslateUsers");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.BanTemplate", b =>
@@ -421,7 +415,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("BanTemplates", (string)null);
b.ToTable("BanTemplates");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.BlacklistEntry", b =>
@@ -441,7 +435,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("Blacklist", (string)null);
b.ToTable("Blacklist");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandAlias", b =>
@@ -466,7 +460,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("CommandAlias", (string)null);
b.ToTable("CommandAlias");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.CommandCooldown", b =>
@@ -491,7 +485,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("CommandCooldown", (string)null);
b.ToTable("CommandCooldown");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.CurrencyTransaction", b =>
@@ -529,7 +523,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("CurrencyTransactions", (string)null);
b.ToTable("CurrencyTransactions");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.DelMsgOnCmdChannel", b =>
@@ -554,7 +548,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("DelMsgOnCmdChannel", (string)null);
b.ToTable("DelMsgOnCmdChannel");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.DiscordPermOverride", b =>
@@ -580,7 +574,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId", "Command")
.IsUnique();
b.ToTable("DiscordPermOverrides", (string)null);
b.ToTable("DiscordPermOverrides");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ExcludedItem", b =>
@@ -605,7 +599,7 @@ namespace NadekoBot.Migrations
b.HasIndex("XpSettingsId");
b.ToTable("ExcludedItem", (string)null);
b.ToTable("ExcludedItem");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.FeedSub", b =>
@@ -631,7 +625,7 @@ namespace NadekoBot.Migrations
b.HasAlternateKey("GuildConfigId", "Url");
b.ToTable("FeedSub", (string)null);
b.ToTable("FeedSub");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilterChannelId", b =>
@@ -653,7 +647,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("FilterChannelId", (string)null);
b.ToTable("FilterChannelId");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilteredWord", b =>
@@ -675,7 +669,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("FilteredWord", (string)null);
b.ToTable("FilteredWord");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilterLinksChannelId", b =>
@@ -697,7 +691,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("FilterLinksChannelId", (string)null);
b.ToTable("FilterLinksChannelId");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.FilterWordsChannelId", b =>
@@ -719,7 +713,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("FilterWordsChannelId", (string)null);
b.ToTable("FilterWordsChannelId");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.GCChannelId", b =>
@@ -741,7 +735,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("GCChannelId", (string)null);
b.ToTable("GCChannelId");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.GroupName", b =>
@@ -767,7 +761,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId", "Number")
.IsUnique();
b.ToTable("GroupName", (string)null);
b.ToTable("GroupName");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.GuildConfig", b =>
@@ -891,7 +885,7 @@ namespace NadekoBot.Migrations
b.HasIndex("WarnExpireHours");
b.ToTable("GuildConfigs", (string)null);
b.ToTable("GuildConfigs");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredLogItem", b =>
@@ -917,7 +911,7 @@ namespace NadekoBot.Migrations
b.HasIndex("LogSettingId", "LogItemId", "ItemType")
.IsUnique();
b.ToTable("IgnoredLogChannels", (string)null);
b.ToTable("IgnoredLogChannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.IgnoredVoicePresenceChannel", b =>
@@ -939,7 +933,7 @@ namespace NadekoBot.Migrations
b.HasIndex("LogSettingId");
b.ToTable("IgnoredVoicePresenceCHannels", (string)null);
b.ToTable("IgnoredVoicePresenceCHannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ImageOnlyChannel", b =>
@@ -962,7 +956,7 @@ namespace NadekoBot.Migrations
b.HasIndex("ChannelId")
.IsUnique();
b.ToTable("ImageOnlyChannels", (string)null);
b.ToTable("ImageOnlyChannels");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.LogSetting", b =>
@@ -1027,7 +1021,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("LogSettings", (string)null);
b.ToTable("LogSettings");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.MusicPlayerSettings", b =>
@@ -1064,7 +1058,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("MusicPlayerSettings", (string)null);
b.ToTable("MusicPlayerSettings");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.MusicPlaylist", b =>
@@ -1087,7 +1081,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("MusicPlaylists", (string)null);
b.ToTable("MusicPlaylists");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.MutedUserId", b =>
@@ -1109,7 +1103,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("MutedUserId", (string)null);
b.ToTable("MutedUserId");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.NadekoExpression", b =>
@@ -1147,7 +1141,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("Expressions", (string)null);
b.ToTable("Expressions");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.NsfwBlacklistedTag", b =>
@@ -1169,7 +1163,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId");
b.ToTable("NsfwBlacklistedTags", (string)null);
b.ToTable("NsfwBlacklistedTags");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Permissionv2", b =>
@@ -1209,7 +1203,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("Permissions", (string)null);
b.ToTable("Permissions");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlantedCurrency", b =>
@@ -1246,7 +1240,7 @@ namespace NadekoBot.Migrations
b.HasIndex("MessageId")
.IsUnique();
b.ToTable("PlantedCurrency", (string)null);
b.ToTable("PlantedCurrency");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.PlaylistSong", b =>
@@ -1280,7 +1274,7 @@ namespace NadekoBot.Migrations
b.HasIndex("MusicPlaylistId");
b.ToTable("PlaylistSong", (string)null);
b.ToTable("PlaylistSong");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Poll", b =>
@@ -1306,7 +1300,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId")
.IsUnique();
b.ToTable("Poll", (string)null);
b.ToTable("Poll");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.PollAnswer", b =>
@@ -1331,7 +1325,7 @@ namespace NadekoBot.Migrations
b.HasIndex("PollId");
b.ToTable("PollAnswer", (string)null);
b.ToTable("PollAnswer");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.PollVote", b =>
@@ -1356,7 +1350,7 @@ namespace NadekoBot.Migrations
b.HasIndex("PollId");
b.ToTable("PollVote", (string)null);
b.ToTable("PollVote");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Quote", b =>
@@ -1392,7 +1386,7 @@ namespace NadekoBot.Migrations
b.HasIndex("Keyword");
b.ToTable("Quotes", (string)null);
b.ToTable("Quotes");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ReactionRole", b =>
@@ -1417,7 +1411,7 @@ namespace NadekoBot.Migrations
b.HasIndex("ReactionRoleMessageId");
b.ToTable("ReactionRole", (string)null);
b.ToTable("ReactionRole");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ReactionRoleMessage", b =>
@@ -1448,7 +1442,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("ReactionRoleMessage", (string)null);
b.ToTable("ReactionRoleMessage");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Reminder", b =>
@@ -1482,7 +1476,7 @@ namespace NadekoBot.Migrations
b.HasIndex("When");
b.ToTable("Reminders", (string)null);
b.ToTable("Reminders");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Repeater", b =>
@@ -1517,7 +1511,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("Repeaters", (string)null);
b.ToTable("Repeaters");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.RewardedUser", b =>
@@ -1546,7 +1540,7 @@ namespace NadekoBot.Migrations
b.HasIndex("PatreonUserId")
.IsUnique();
b.ToTable("RewardedUsers", (string)null);
b.ToTable("RewardedUsers");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.RotatingPlayingStatus", b =>
@@ -1566,7 +1560,7 @@ namespace NadekoBot.Migrations
b.HasKey("Id");
b.ToTable("RotatingStatus", (string)null);
b.ToTable("RotatingStatus");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.SelfAssignedRole", b =>
@@ -1597,7 +1591,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildId", "RoleId")
.IsUnique();
b.ToTable("SelfAssignableRoles", (string)null);
b.ToTable("SelfAssignableRoles");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ShopEntry", b =>
@@ -1637,7 +1631,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("ShopEntry", (string)null);
b.ToTable("ShopEntry");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.ShopEntryItem", b =>
@@ -1659,7 +1653,7 @@ namespace NadekoBot.Migrations
b.HasIndex("ShopEntryId");
b.ToTable("ShopEntryItem", (string)null);
b.ToTable("ShopEntryItem");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.SlowmodeIgnoredRole", b =>
@@ -1681,7 +1675,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("SlowmodeIgnoredRole", (string)null);
b.ToTable("SlowmodeIgnoredRole");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.SlowmodeIgnoredUser", b =>
@@ -1703,7 +1697,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("SlowmodeIgnoredUser", (string)null);
b.ToTable("SlowmodeIgnoredUser");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.StreamRoleBlacklistedUser", b =>
@@ -1728,7 +1722,7 @@ namespace NadekoBot.Migrations
b.HasIndex("StreamRoleSettingsId");
b.ToTable("StreamRoleBlacklistedUser", (string)null);
b.ToTable("StreamRoleBlacklistedUser");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.StreamRoleSettings", b =>
@@ -1760,7 +1754,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId")
.IsUnique();
b.ToTable("StreamRoleSettings", (string)null);
b.ToTable("StreamRoleSettings");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.StreamRoleWhitelistedUser", b =>
@@ -1785,7 +1779,7 @@ namespace NadekoBot.Migrations
b.HasIndex("StreamRoleSettingsId");
b.ToTable("StreamRoleWhitelistedUser", (string)null);
b.ToTable("StreamRoleWhitelistedUser");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.UnbanTimer", b =>
@@ -1810,7 +1804,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("UnbanTimer", (string)null);
b.ToTable("UnbanTimer");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.UnmuteTimer", b =>
@@ -1835,7 +1829,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("UnmuteTimer", (string)null);
b.ToTable("UnmuteTimer");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.UnroleTimer", b =>
@@ -1863,7 +1857,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("UnroleTimer", (string)null);
b.ToTable("UnroleTimer");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.UserXpStats", b =>
@@ -1884,7 +1878,7 @@ namespace NadekoBot.Migrations
b.Property<DateTime>("LastLevelUp")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasDefaultValue(new DateTime(2017, 9, 21, 20, 53, 13, 307, DateTimeKind.Local));
.HasDefaultValueSql("datetime('now')");
b.Property<int>("NotifyOnLevelUp")
.HasColumnType("INTEGER");
@@ -1908,7 +1902,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId", "GuildId")
.IsUnique();
b.ToTable("UserXpStats", (string)null);
b.ToTable("UserXpStats");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.VcRoleInfo", b =>
@@ -1933,7 +1927,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("VcRoleInfo", (string)null);
b.ToTable("VcRoleInfo");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.WaifuInfo", b =>
@@ -1968,7 +1962,7 @@ namespace NadekoBot.Migrations
b.HasIndex("WaifuId")
.IsUnique();
b.ToTable("WaifuInfo", (string)null);
b.ToTable("WaifuInfo");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.WaifuItem", b =>
@@ -1993,7 +1987,7 @@ namespace NadekoBot.Migrations
b.HasIndex("WaifuInfoId");
b.ToTable("WaifuItem", (string)null);
b.ToTable("WaifuItem");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.WaifuUpdate", b =>
@@ -2025,7 +2019,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("WaifuUpdates", (string)null);
b.ToTable("WaifuUpdates");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.Warning", b =>
@@ -2068,7 +2062,7 @@ namespace NadekoBot.Migrations
b.HasIndex("UserId");
b.ToTable("Warnings", (string)null);
b.ToTable("Warnings");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.WarningPunishment", b =>
@@ -2099,7 +2093,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId");
b.ToTable("WarningPunishment", (string)null);
b.ToTable("WarningPunishment");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.XpCurrencyReward", b =>
@@ -2124,7 +2118,7 @@ namespace NadekoBot.Migrations
b.HasIndex("XpSettingsId");
b.ToTable("XpCurrencyReward", (string)null);
b.ToTable("XpCurrencyReward");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.XpRoleReward", b =>
@@ -2153,7 +2147,7 @@ namespace NadekoBot.Migrations
b.HasIndex("XpSettingsId", "Level")
.IsUnique();
b.ToTable("XpRoleReward", (string)null);
b.ToTable("XpRoleReward");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.XpSettings", b =>
@@ -2176,7 +2170,7 @@ namespace NadekoBot.Migrations
b.HasIndex("GuildConfigId")
.IsUnique();
b.ToTable("XpSettings", (string)null);
b.ToTable("XpSettings");
});
modelBuilder.Entity("NadekoBot.Db.Models.ClubApplicants", b =>
@@ -2222,8 +2216,7 @@ namespace NadekoBot.Migrations
b.HasOne("NadekoBot.Db.Models.DiscordUser", "Owner")
.WithOne()
.HasForeignKey("NadekoBot.Db.Models.ClubInfo", "OwnerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("Owner");
});
@@ -2231,8 +2224,9 @@ namespace NadekoBot.Migrations
modelBuilder.Entity("NadekoBot.Db.Models.DiscordUser", b =>
{
b.HasOne("NadekoBot.Db.Models.ClubInfo", "Club")
.WithMany("Users")
.HasForeignKey("ClubId");
.WithMany("Members")
.HasForeignKey("ClubId")
.OnDelete(DeleteBehavior.NoAction);
b.Navigation("Club");
});
@@ -2561,9 +2555,11 @@ namespace NadekoBot.Migrations
modelBuilder.Entity("NadekoBot.Services.Database.Models.WaifuItem", b =>
{
b.HasOne("NadekoBot.Services.Database.Models.WaifuInfo", null)
b.HasOne("NadekoBot.Services.Database.Models.WaifuInfo", "WaifuInfo")
.WithMany("Items")
.HasForeignKey("WaifuInfoId");
b.Navigation("WaifuInfo");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.WaifuUpdate", b =>
@@ -2635,7 +2631,7 @@ namespace NadekoBot.Migrations
b.Navigation("Bans");
b.Navigation("Users");
b.Navigation("Members");
});
modelBuilder.Entity("NadekoBot.Services.Database.Models.AntiSpamSetting", b =>