Add schema changes for autoproxy

This commit is contained in:
Ske 2020-01-23 20:19:50 +01:00
parent b347d2d557
commit bf70a6e3e1
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,13 @@
-- Same sort of psuedo-enum due to Dapper limitations. See 2.sql.
-- 1 = autoproxy off
-- 2 = front mode (first fronter)
-- 3 = latch mode (last proxyer)
-- 4 = member mode (specific member)
alter table system_guild add column autoproxy_mode int check (autoproxy_mode in (1, 2, 3, 4)) not null default 1;
-- for member mode
alter table system_guild add column autoproxy_member nullable references members (id) on delete set null;
-- for latch mode
-- not *really* nullable, null just means old (pre-schema-change) data.
alter table messages add column guild bigint nullable default null;

View File

@ -9,6 +9,14 @@ using NodaTime;
using Serilog;
namespace PluralKit {
public enum AutoproxyMode
{
Off = 1,
Front = 2,
Latch = 3,
Member = 4
}
public class FullMessage
{
public PKMessage Message;
@ -19,6 +27,7 @@ namespace PluralKit {
public struct PKMessage
{
public ulong Mid;
public ulong? Guild; // null value means "no data" (ie. from before this field being added)
public ulong Channel;
public ulong Sender;
public ulong? OriginalMid;
@ -63,6 +72,8 @@ namespace PluralKit {
public ulong? LogChannel { get; set; }
public ISet<ulong> LogBlacklist { get; set; }
public ISet<ulong> Blacklist { get; set; }
public AutoproxyMode AutoproxyMode { get; set; }
public int AutoproxyMember { get; set; }
}
public class SystemGuildSettings