feat: alternate proxy switch mode "add" (#702)

* feat: alternate proxy switch mode "add"

* docs: add proxy switch add to docs

* chore: change default alias to proxy switch new from proxy switch on
This commit is contained in:
Petal Ladenson 2024-12-05 18:24:20 -07:00 committed by GitHub
parent e44d813b73
commit 6043d31b08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 76 additions and 19 deletions

View file

@ -34,6 +34,6 @@ public class MessageContext
public int? LatchTimeout { get; }
public bool CaseSensitiveProxyTags { get; }
public bool ProxyErrorMessageEnabled { get; }
public bool ProxySwitch { get; }
public SystemConfig.ProxySwitchAction ProxySwitch { get; }
public bool DenyBotUsage { get; }
}

View file

@ -9,7 +9,7 @@ create function message_context(account_id bigint, guild_id bigint, channel_id b
latch_timeout integer,
case_sensitive_proxy_tags bool,
proxy_error_message_enabled bool,
proxy_switch bool,
proxy_switch int,
name_format text,
tag_enabled bool,

View file

@ -0,0 +1,11 @@
-- database version 50
-- change proxy switch config to an enum
alter table system_config
alter column proxy_switch drop default,
alter column proxy_switch type int
using case when proxy_switch then 1 else 0 end,
alter column proxy_switch set default 0,
add constraint proxy_switch_check check (proxy_switch = ANY (ARRAY[0,1,2]));
update info set schema_version = 50;

View file

@ -9,7 +9,7 @@ namespace PluralKit.Core;
internal class DatabaseMigrator
{
private const string RootPath = "PluralKit.Core.Database"; // "resource path" root for SQL files
private const int TargetSchemaVersion = 49;
private const int TargetSchemaVersion = 50;
private readonly ILogger _logger;
public DatabaseMigrator(ILogger logger)