mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-08 23:07:54 +00:00
Add per-system member/group limit override
This commit is contained in:
parent
1e8470e77f
commit
1fda6ec919
8 changed files with 30 additions and 12 deletions
|
|
@ -19,7 +19,7 @@ namespace PluralKit.Core
|
|||
internal class Database: IDatabase
|
||||
{
|
||||
private const string RootPath = "PluralKit.Core.Database"; // "resource path" root for SQL files
|
||||
private const int TargetSchemaVersion = 9;
|
||||
private const int TargetSchemaVersion = 10;
|
||||
|
||||
private readonly CoreConfig _config;
|
||||
private readonly ILogger _logger;
|
||||
|
|
|
|||
11
PluralKit.Core/Database/Migrations/10.sql
Normal file
11
PluralKit.Core/Database/Migrations/10.sql
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
-- SCHEMA VERSION 10: 2020-10-09 --
|
||||
-- Member/group limit override per-system
|
||||
|
||||
alter table systems add column member_limit_override smallint default null;
|
||||
alter table systems add column group_limit_override smallint default null;
|
||||
|
||||
-- Lowering global limit to 1000 in this commit, so increase it for systems already above that
|
||||
update systems s set member_count_override = 1500
|
||||
where (select count(*) from members m where m.system = s.id) > 1000;
|
||||
|
||||
update info set schema_version = 10;
|
||||
|
|
@ -23,6 +23,8 @@ namespace PluralKit.Core {
|
|||
public PrivacyLevel FrontPrivacy { get; }
|
||||
public PrivacyLevel FrontHistoryPrivacy { get; }
|
||||
public PrivacyLevel GroupListPrivacy { get; }
|
||||
public int? MemberLimitOverride { get; }
|
||||
public int? GroupLimitOverride { get; }
|
||||
|
||||
[JsonIgnore] public DateTimeZone Zone => DateTimeZoneProviders.Tzdb.GetZoneOrNull(UiTz);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace PluralKit.Core {
|
|||
|
||||
public static readonly int MaxSystemNameLength = 100;
|
||||
public static readonly int MaxSystemTagLength = MaxProxyNameLength - 1;
|
||||
public static readonly int MaxMemberCount = 1500;
|
||||
public static readonly int MaxMemberCount = 1000;
|
||||
public static readonly int MaxMembersWarnThreshold = MaxMemberCount - 50;
|
||||
public static readonly int MaxGroupCount = 250;
|
||||
public static readonly int MaxDescriptionLength = 1000;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue