Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3387188
D11986.id40074.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.id40074.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
Sat, Nov 30, 8:10 AM (19 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2600217
Default Alt Text
D11986.id40074.diff (1 KB)
Attached To
Mode
D11986: [keyserver] Introduce user_container column to uploads table
Attached
Detach File
Event Timeline
Log In to Comment