Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3368152
D11986.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11986.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11986: [keyserver] Introduce user_container column to uploads table
Attached
Detach File
Event Timeline
Log In to Comment