Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/database/setup-db.js
Show First 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | SQL` | ||||
\`primary\` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, | \`primary\` tinyint(1) UNSIGNED NOT NULL DEFAULT 0, | ||||
role bigint(20) NOT NULL, | role bigint(20) NOT NULL, | ||||
community bigint(20) NOT NULL, | community bigint(20) NOT NULL, | ||||
expiration_time bigint(20), | expiration_time bigint(20), | ||||
limit_of_uses int UNSIGNED, | limit_of_uses int UNSIGNED, | ||||
number_of_uses int UNSIGNED NOT NULL DEFAULT 0 | number_of_uses int UNSIGNED NOT NULL DEFAULT 0 | ||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||
CREATE TABLE olm_sessions ( | |||||
cookie_id bigint(20) NOT NULL, | |||||
is_content tinyint(1) NOT NULL, | |||||
version bigint(20) NOT NULL, | |||||
pickled_olm_session text | |||||
CHARACTER SET ascii | |||||
ashoat: Character set should be `latin1` here | |||||
ashoatUnsubmitted Not Done Inline Actions@marcin forget to leave a comment here explaining the follow-up. He git pushed a commit that resolved this ashoat: @marcin forget to leave a comment here explaining the follow-up. He `git push`ed a commit that… | |||||
COLLATE latin1_bin NOT NULL | |||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin; | |||||
ALTER TABLE cookies | ALTER TABLE cookies | ||||
ADD PRIMARY KEY (id), | ADD PRIMARY KEY (id), | ||||
ADD UNIQUE KEY device_token (device_token(512)), | ADD UNIQUE KEY device_token (device_token(512)), | ||||
ADD KEY user_device_token (user,device_token(512)); | ADD KEY user_device_token (user,device_token(512)); | ||||
ALTER TABLE days | ALTER TABLE days | ||||
ADD PRIMARY KEY (id), | ADD PRIMARY KEY (id), | ||||
ADD UNIQUE KEY date_thread (date,thread) USING BTREE; | ADD UNIQUE KEY date_thread (date,thread) USING BTREE; | ||||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | SQL` | ||||
ALTER TABLE message_search | ALTER TABLE message_search | ||||
ADD PRIMARY KEY (original_message_id), | ADD PRIMARY KEY (original_message_id), | ||||
ADD FULLTEXT INDEX processed_content (processed_content); | ADD FULLTEXT INDEX processed_content (processed_content); | ||||
ALTER TABLE invite_links | ALTER TABLE invite_links | ||||
ADD PRIMARY KEY (id), | ADD PRIMARY KEY (id), | ||||
ADD UNIQUE KEY (name), | ADD UNIQUE KEY (name), | ||||
ADD INDEX community_primary (community, \`primary\`); | ADD INDEX community_primary (community, \`primary\`); | ||||
ALTER TABLE olm_sessions | |||||
ADD PRIMARY KEY (cookie_id, is_content); | |||||
`, | `, | ||||
{ multipleStatements: true }, | { multipleStatements: true }, | ||||
); | ); | ||||
} | } | ||||
async function createUsers() { | async function createUsers() { | ||||
const [user1, user2] = sortIDs(bots.commbot.userID, ashoat.id); | const [user1, user2] = sortIDs(bots.commbot.userID, ashoat.id); | ||||
await dbQuery( | await dbQuery( | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |
Character set should be latin1 here