mirror of https://gitlab.com/litecord/litecord.git
Merge branch 'master' of https://gitlab.com/luna/litecord
This commit is contained in:
commit
efdcbf9937
|
|
@ -133,9 +133,9 @@ async def create_guild():
|
||||||
# is the same as the id of the guild, and create_role
|
# is the same as the id of the guild, and create_role
|
||||||
# generates a new snowflake.
|
# generates a new snowflake.
|
||||||
await app.db.execute("""
|
await app.db.execute("""
|
||||||
INSERT INTO roles (id, guild_id, name, position, permissions, color)
|
INSERT INTO roles (id, guild_id, name, position, permissions)
|
||||||
VALUES ($1, $2, $3, $4, $5, $6)
|
VALUES ($1, $2, $3, $4, $5)
|
||||||
""", guild_id, guild_id, '@everyone', 0, DEFAULT_EVERYONE_PERMS, 0)
|
""", guild_id, guild_id, '@everyone', 0, DEFAULT_EVERYONE_PERMS)
|
||||||
|
|
||||||
# add the @everyone role to the guild creator
|
# add the @everyone role to the guild creator
|
||||||
await app.db.execute("""
|
await app.db.execute("""
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,9 @@ REGISTER = {
|
||||||
'password': {'type': 'string', 'minlength': 5, 'required': True}
|
'password': {'type': 'string', 'minlength': 5, 'required': True}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# only used by us, not discord, hence 'invcode' (to separate from discord)
|
||||||
REGISTER_WITH_INVITE = {**REGISTER, **{
|
REGISTER_WITH_INVITE = {**REGISTER, **{
|
||||||
'invite': {'type': 'string', 'required': True}
|
'invcode': {'type': 'string', 'required': True}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
-- update roles.color default to 0
|
||||||
|
ALTER TABLE roles
|
||||||
|
ALTER COLUMN color SET DEFAULT 0;
|
||||||
|
|
||||||
|
-- update all existing guild default roles to
|
||||||
|
-- color=0
|
||||||
|
UPDATE roles
|
||||||
|
SET color = 0
|
||||||
|
WHERE roles.id = roles.guild_id;
|
||||||
|
|
@ -519,7 +519,7 @@ CREATE TABLE IF NOT EXISTS roles (
|
||||||
guild_id bigint REFERENCES guilds (id) ON DELETE CASCADE,
|
guild_id bigint REFERENCES guilds (id) ON DELETE CASCADE,
|
||||||
|
|
||||||
name text NOT NULL,
|
name text NOT NULL,
|
||||||
color int DEFAULT 1,
|
color int DEFAULT 0,
|
||||||
hoist bool DEFAULT false,
|
hoist bool DEFAULT false,
|
||||||
position int NOT NULL,
|
position int NOT NULL,
|
||||||
permissions int NOT NULL,
|
permissions int NOT NULL,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue