Page MenuHomePhabricator

D7560.id26278.diff
No OneTemporary

D7560.id26278.diff

diff --git a/keyserver/src/database/migration-config.js b/keyserver/src/database/migration-config.js
--- a/keyserver/src/database/migration-config.js
+++ b/keyserver/src/database/migration-config.js
@@ -381,6 +381,29 @@
);
},
],
+ [
+ 34,
+ async () => {
+ await dbQuery(
+ SQL`
+ CREATE TABLE IF NOT EXISTS olm_accounts (
+ is_content tinyint(1) NOT NULL,
+ version bigint(20) NOT NULL,
+ pickling_key text
+ CHARACTER SET latin1
+ COLLATE latin1_bin NOT NULL,
+ pickled_olm_account text
+ CHARACTER SET latin1
+ COLLATE latin1_bin NOT NULL
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+
+ ALTER TABLE olm_accounts
+ ADD PRIMARY KEY (is_content);
+ `,
+ { multipleStatements: true },
+ );
+ },
+ ],
]);
const newDatabaseVersion: number = Math.max(...migrations.keys());
diff --git a/keyserver/src/database/setup-db.js b/keyserver/src/database/setup-db.js
--- a/keyserver/src/database/setup-db.js
+++ b/keyserver/src/database/setup-db.js
@@ -269,6 +269,17 @@
COLLATE latin1_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+ CREATE TABLE olm_accounts (
+ is_content tinyint(1) NOT NULL,
+ version bigint(20) NOT NULL,
+ pickling_key text
+ CHARACTER SET latin1
+ COLLATE latin1_bin NOT NULL,
+ pickled_olm_account text
+ CHARACTER SET latin1
+ COLLATE latin1_bin NOT NULL
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+
ALTER TABLE cookies
ADD PRIMARY KEY (id),
ADD UNIQUE KEY device_token (device_token(512)),
@@ -396,6 +407,9 @@
ALTER TABLE olm_sessions
ADD PRIMARY KEY (cookie_id, is_content);
+
+ ALTER TABLE olm_accounts
+ ADD PRIMARY KEY (is_content);
`,
{ multipleStatements: true },
);

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 2, 6:27 AM (7 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2606866
Default Alt Text
D7560.id26278.diff (1 KB)

Event Timeline