- Removed all migrations, added squash instead which will build the database, prerequisite for this migration to be skipped is to be on the latest version of 2.x before moving over

- Added cleanup migration, it will clean the ef migration history, and delete unused fields
- Started working on README.md
This commit is contained in:
Kwoth
2021-06-21 09:55:53 +02:00
parent 34f6902c95
commit 1ca8f188cd
251 changed files with 3910 additions and 223484 deletions

View File

@@ -4,22 +4,5 @@
{
public string Trigger { get; set; }
public string Mapping { get; set; }
//// override object.Equals
//public override bool Equals(object obj)
//{
// if (obj is null || GetType() != obj.GetType())
// {
// return false;
// }
// return ((CommandAlias)obj).Trigger.Trim().ToLowerInvariant() == Trigger.Trim().ToLowerInvariant();
//}
//// override object.GetHashCode
//public override int GetHashCode()
//{
// return Trigger.Trim().ToLowerInvariant().GetHashCode();
//}
}
}

View File

@@ -7,20 +7,6 @@ namespace NadekoBot.Services.Database.Models
{
public class CustomReaction : DbEntity
{
#region Unused
[Obsolete]
[NotMapped]
public Regex Regex { get; set; }
[Obsolete]
public ulong UseCount { get; set; }
[Obsolete]
public bool IsRegex { get; set; }
[Obsolete]
public bool OwnerOnly { get; set; }
#endregion
public ulong? GuildId { get; set; }
public string Response { get; set; }
public string Trigger { get; set; }

View File

@@ -13,8 +13,6 @@ namespace NadekoBot.Services.Database.Models
public bool DeleteMessageOnCommand { get; set; }
public HashSet<DelMsgOnCmdChannel> DelMsgOnCmdChannels { get; set; } = new HashSet<DelMsgOnCmdChannel>();
[Obsolete("Use autoassignroleids")]
public ulong AutoAssignRoleId { get; set; }
public string AutoAssignRoleIds { get; set; }
//greet stuff
public bool AutoDeleteGreetMessages { get; set; } //unused
@@ -39,8 +37,6 @@ namespace NadekoBot.Services.Database.Models
//self assignable roles
public bool ExclusiveSelfAssignedRoles { get; set; }
public bool AutoDeleteSelfAssignedRoleMessages { get; set; }
public float DefaultMusicVolume { get; set; } = 1.0f;
public bool VoicePlusTextEnabled { get; set; }
//stream notifications
public HashSet<FollowedStream> FollowedStreams { get; set; } = new HashSet<FollowedStream>();
@@ -48,8 +44,6 @@ namespace NadekoBot.Services.Database.Models
//currencyGeneration
public HashSet<GCChannelId> GenerateCurrencyChannelIds { get; set; } = new HashSet<GCChannelId>();
//permissions
public Permission RootPermission { get; set; } = null;
public List<Permissionv2> Permissions { get; set; }
public bool VerbosePermissions { get; set; } = true;
public string PermissionRole { get; set; } = null;
@@ -100,7 +94,6 @@ namespace NadekoBot.Services.Database.Models
public XpSettings XpSettings { get; set; }
public List<FeedSub> FeedSubs { get; set; } = new List<FeedSub>();
public bool AutoDcFromVc { get; set; }
public IndexedCollection<ReactionRoleMessage> ReactionRoleMessages { get; set; } = new IndexedCollection<ReactionRoleMessage>();
public bool NotifyStreamOffline { get; set; }
public List<GroupName> SelfAssignableRoleGroupNames { get; set; }

View File

@@ -8,98 +8,28 @@ namespace NadekoBot.Services.Database.Models
public HashSet<IgnoredLogChannel> IgnoredChannels { get; set; } = new HashSet<IgnoredLogChannel>();
public HashSet<IgnoredVoicePresenceChannel> IgnoredVoicePresenceChannelIds { get; set; } = new HashSet<IgnoredVoicePresenceChannel>();
public ulong? LogOtherId { get; set; } = null;
public ulong? MessageUpdatedId { get; set; } = null;
public ulong? MessageDeletedId { get; set; } = null;
public ulong? LogOtherId { get; set; }
public ulong? MessageUpdatedId { get; set; }
public ulong? MessageDeletedId { get; set; }
public ulong? UserJoinedId { get; set; } = null;
public ulong? UserLeftId { get; set; } = null;
public ulong? UserBannedId { get; set; } = null;
public ulong? UserUnbannedId { get; set; } = null;
public ulong? UserUpdatedId { get; set; } = null;
public ulong? UserJoinedId { get; set; }
public ulong? UserLeftId { get; set; }
public ulong? UserBannedId { get; set; }
public ulong? UserUnbannedId { get; set; }
public ulong? UserUpdatedId { get; set; }
public ulong? ChannelCreatedId { get; set; } = null;
public ulong? ChannelDestroyedId { get; set; } = null;
public ulong? ChannelUpdatedId { get; set; } = null;
public ulong? ChannelCreatedId { get; set; }
public ulong? ChannelDestroyedId { get; set; }
public ulong? ChannelUpdatedId { get; set; }
public ulong? UserMutedId { get; set; }
//userpresence
public ulong? LogUserPresenceId { get; set; } = null;
public ulong? LogUserPresenceId { get; set; }
//voicepresence
public ulong? LogVoicePresenceId { get; set; } = null;
public ulong? LogVoicePresenceTTSId { get; set; } = null;
//-------------------DO NOT USE----------------
// these old fields are here because sqlite doesn't support drop column operation
// will be removed after bot moves to another database provider
/// <summary>
/// DON'T USE
/// </summary>
public bool IsLogging { get; set; }
/// <summary>
/// DON'T USE
/// </summary>
public ulong ChannelId { get; set; }
/// <summary>
/// DON'T USE
/// </summary>
public bool MessageUpdated { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool MessageDeleted { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool UserJoined { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool UserLeft { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool UserBanned { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool UserUnbanned { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool UserUpdated { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool ChannelCreated { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool ChannelDestroyed { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool ChannelUpdated { get; set; } = true;
/// <summary>
/// DON'T USE
/// </summary>
public bool LogUserPresence { get; set; } = false;
/// <summary>
/// DON'T USE
/// </summary>
public ulong UserPresenceChannelId { get; set; }
/// <summary>
/// DON'T USE
/// </summary>
public bool LogVoicePresence { get; set; } = false;
/// <summary>
/// DON'T USE
/// </summary>
public ulong VoicePresenceChannelId { get; set; }
public ulong? LogVoicePresenceId { get; set; }
public ulong? LogVoicePresenceTTSId { get; set; }
}
}

View File

@@ -4,31 +4,6 @@ using System.Diagnostics;
namespace NadekoBot.Services.Database.Models
{
[DebuggerDisplay("{global::NadekoBot.Modules.Permissions.PermissionExtensions.GetCommand(this)}", Target = typeof(Permission))]
public class Permission : DbEntity
{
public Permission Previous { get; set; } = null;
public Permission Next { get; set; } = null;
public PrimaryPermissionType PrimaryTarget { get; set; }
public ulong PrimaryTargetId { get; set; }
public SecondaryPermissionType SecondaryTarget { get; set; }
public string SecondaryTargetName { get; set; }
public bool State { get; set; }
public Permissionv2 Tov2() =>
new Permissionv2()
{
PrimaryTarget = PrimaryTarget,
PrimaryTargetId = PrimaryTargetId,
SecondaryTarget = SecondaryTarget,
SecondaryTargetName = SecondaryTargetName,
State = State,
};
}
public interface IIndexed
{
int Index { get; set; }

View File

@@ -12,7 +12,6 @@ namespace NadekoBot.Services.Database.Models
public ulong AuthorId { get; set; }
[Required]
public string Text { get; set; }
public ulong UseCount { get; set; }
}

View File

@@ -1,14 +0,0 @@
namespace NadekoBot.Services.Database.Models
{
/// <summary>
/// Used to set stakes for gambling games which don't reward right away -
/// like blackjack. If the bot is restarted mid game, users will get their funds back
/// when the bot is back up.
/// </summary>
public class Stake : DbEntity
{
public ulong UserId { get; set; }
public long Amount { get; set; }
public string Source { get; set; }
}
}

View File

@@ -7,11 +7,5 @@ namespace NadekoBot.Services.Database.Models
public int? WaifuInfoId { get; set; }
public string ItemEmoji { get; set; }
public string Name { get; set; }
[Obsolete]
public int Price { get; set; }
[Obsolete]
public int Item { get; set; }
}
}

View File

@@ -9,8 +9,6 @@ namespace NadekoBot.Services.Database.Models
public HashSet<XpRoleReward> RoleRewards { get; set; } = new HashSet<XpRoleReward>();
public HashSet<XpCurrencyReward> CurrencyRewards { get; set; } = new HashSet<XpCurrencyReward>();
public bool XpRoleRewardExclusive { get; set; }
public string NotifyMessage { get; set; } = "Congratulations {0}! You have reached level {1}!";
public HashSet<ExcludedItem> ExclusionList { get; set; } = new HashSet<ExcludedItem>();
public bool ServerExcluded { get; set; }
}

View File

@@ -1,9 +0,0 @@
namespace NadekoBot.Services.Database.Models
{
public class YtFollowedChannel : DbEntity
{
public ulong ChannelId { get; set; }
public string YtChannelId { get; set; }
public string UploadMessage { get; set; }
}
}