Page MenuHomePhabricator

D5883.diff
No OneTemporary

D5883.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
@@ -117,6 +117,18 @@
`);
},
],
+ [
+ 12,
+ async () => {
+ await dbQuery(SQL`
+ CREATE TABLE IF NOT EXISTS siwe_nonces (
+ nonce char(17) NOT NULL,
+ creation_time bigint(20) NOT NULL,
+ PRIMARY KEY (nonce)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ `);
+ },
+ ],
]);
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
@@ -241,6 +241,11 @@
confirmed tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ CREATE TABLE siwe_nonces (
+ nonce char(17) NOT NULL,
+ creation_time bigint(20) NOT NULL,
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
ALTER TABLE cookies
ADD PRIMARY KEY (id),
ADD UNIQUE KEY device_token (device_token),
@@ -353,6 +358,9 @@
ALTER TABLE policy_acknowledgments
ADD PRIMARY KEY (user, policy);
+
+ ALTER TABLE siwe_nonces
+ ADD PRIMARY KEY (nonce);
`,
{ multipleStatements: true },
);

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 3:52 AM (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2685490
Default Alt Text
D5883.diff (1 KB)

Event Timeline