Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/database/setup-db.js
Show All 25 Lines | await dbQuery( | ||||
SQL` | SQL` | ||||
CREATE TABLE cookies ( | CREATE TABLE cookies ( | ||||
id bigint(20) NOT NULL, | id bigint(20) NOT NULL, | ||||
hash char(60) NOT NULL, | hash char(60) NOT NULL, | ||||
user bigint(20) DEFAULT NULL, | user bigint(20) DEFAULT NULL, | ||||
platform varchar(255) DEFAULT NULL, | platform varchar(255) DEFAULT NULL, | ||||
creation_time bigint(20) NOT NULL, | creation_time bigint(20) NOT NULL, | ||||
last_used bigint(20) NOT NULL, | last_used bigint(20) NOT NULL, | ||||
device_token varchar(255) DEFAULT NULL, | device_token mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, | ||||
versions json DEFAULT NULL, | versions json DEFAULT NULL, | ||||
device_id varchar(255) DEFAULT NULL, | device_id varchar(255) DEFAULT NULL, | ||||
signed_identity_keys mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, | signed_identity_keys mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, | ||||
social_proof mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, | social_proof mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, | ||||
\`primary\` TINYINT(1) DEFAULT NULL | \`primary\` TINYINT(1) DEFAULT NULL | ||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; | ||||
CREATE TABLE days ( | CREATE TABLE days ( | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | SQL` | ||||
CREATE TABLE siwe_nonces ( | CREATE TABLE siwe_nonces ( | ||||
nonce char(17) NOT NULL, | nonce char(17) NOT NULL, | ||||
creation_time bigint(20) NOT NULL | creation_time bigint(20) NOT NULL | ||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||||
ALTER TABLE cookies | ALTER TABLE cookies | ||||
ADD PRIMARY KEY (id), | ADD PRIMARY KEY (id), | ||||
ADD UNIQUE KEY device_token (device_token), | ADD UNIQUE KEY device_token (device_token(512)), | ||||
ADD KEY user_device_token (user,device_token); | 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; | ||||
ALTER TABLE entries | ALTER TABLE entries | ||||
ADD PRIMARY KEY (id), | ADD PRIMARY KEY (id), | ||||
ADD UNIQUE KEY creator_creation (creator,creation), | ADD UNIQUE KEY creator_creation (creator,creation), | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |