Various fixes and improvements
This commit is contained in:
@@ -20,7 +20,8 @@ create table groups (
|
||||
|
||||
create table group_members (
|
||||
group_id int not null references groups(id) on delete cascade,
|
||||
member_id int not null references members(id) on delete cascade
|
||||
member_id int not null references members(id) on delete cascade,
|
||||
primary key (group_id, member_id)
|
||||
);
|
||||
|
||||
update info set schema_version = 9;
|
||||
|
@@ -29,8 +29,8 @@ namespace PluralKit.Core
|
||||
public static Task<PKMember?> QueryMemberByHid(this IPKConnection conn, string hid) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKMember?>("select * from members where hid = @hid", new {hid = hid.ToLowerInvariant()});
|
||||
|
||||
public static Task<PKGroup?> QueryGroupByName(this IPKConnection conn, string name) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where lower(name) = lower(@name)", new {name = name});
|
||||
public static Task<PKGroup?> QueryGroupByName(this IPKConnection conn, SystemId system, string name) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where system = @System and lower(Name) = lower(@Name)", new {System = system, Name = name});
|
||||
|
||||
public static Task<PKGroup?> QueryGroupByHid(this IPKConnection conn, string hid) =>
|
||||
conn.QueryFirstOrDefaultAsync<PKGroup?>("select * from groups where hid = @hid", new {hid = hid.ToLowerInvariant()});
|
||||
|
@@ -7,7 +7,7 @@ namespace PluralKit.Core {
|
||||
public static readonly int MaxSystemTagLength = MaxProxyNameLength - 1;
|
||||
public static readonly int MaxMemberCount = 1500;
|
||||
public static readonly int MaxMembersWarnThreshold = MaxMemberCount - 50;
|
||||
public static readonly int MaxGroupCount = 50; // TODO: up to 100+?
|
||||
public static readonly int MaxGroupCount = 100; // TODO: up to 200+?
|
||||
public static readonly int MaxDescriptionLength = 1000;
|
||||
public static readonly int MaxMemberNameLength = 100; // Fair bit larger than MaxProxyNameLength for bookkeeping
|
||||
public static readonly int MaxGroupNameLength = 100;
|
||||
|
Reference in New Issue
Block a user