Page MenuHomePhabricator

D11986.diff
No OneTemporary

D11986.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
@@ -780,6 +780,26 @@
);
},
],
+ [
+ 63,
+ async () => {
+ await dbQuery(
+ SQL`
+ ALTER TABLE uploads
+ ADD COLUMN user_container varchar(255)
+ CHARSET latin1
+ COLLATE latin1_bin
+ DEFAULT NULL
+ AFTER container,
+ ADD INDEX user_container (user_container);
+ UPDATE IGNORE uploads u
+ INNER JOIN users us ON us.id = u.container
+ SET u.container = NULL, u.user_container = us.id;
+ `,
+ { 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
@@ -197,6 +197,8 @@
thread bigint(20) DEFAULT NULL,
uploader varchar(255) CHARSET latin1 COLLATE latin1_bin NOT NULL,
container bigint(20) DEFAULT NULL,
+ user_container varchar(255)
+ CHARSET latin1 COLLATE latin1_bin DEFAULT NULL,
type varchar(255) CHARSET latin1 COLLATE latin1_swedish_ci NOT NULL,
filename varchar(255) NOT NULL,
mime varchar(255) CHARSET latin1 COLLATE latin1_swedish_ci NOT NULL,
@@ -374,6 +376,7 @@
ALTER TABLE uploads
ADD PRIMARY KEY (id),
ADD INDEX container (container),
+ ADD INDEX user_container (user_container),
ADD INDEX thread (thread);
ALTER TABLE users

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 6:24 PM (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585743
Default Alt Text
D11986.diff (1 KB)

Event Timeline