Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32508621
D7519.1767084126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7519.1767084126.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
@@ -325,6 +325,30 @@
await dbQuery(SQL`DROP TABLE versions;`);
},
],
+ [
+ 31,
+ async () => {
+ await dbQuery(
+ SQL`
+ CREATE TABLE IF NOT EXISTS invite_links (
+ id bigint(20) NOT NULL,
+ name varchar(255) CHARSET latin1 NOT NULL,
+ \`primary\` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
+ role bigint(20) NOT NULL,
+ community bigint(20) NOT NULL,
+ expiration_time bigint(20),
+ limit_of_uses int UNSIGNED,
+ number_of_uses int UNSIGNED NOT NULL DEFAULT 0
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+ ALTER TABLE invite_links
+ ADD PRIMARY KEY (id),
+ ADD UNIQUE KEY (name),
+ ADD INDEX community_primary (community, \`primary\`);
+ `,
+ { 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
@@ -249,6 +249,17 @@
processed_content mediumtext COLLATE utf8mb4_bin
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+ CREATE TABLE invite_links (
+ id bigint(20) NOT NULL,
+ name varchar(255) CHARSET latin1 NOT NULL,
+ \`primary\` tinyint(1) UNSIGNED NOT NULL DEFAULT 0,
+ role bigint(20) NOT NULL,
+ community bigint(20) NOT NULL,
+ expiration_time bigint(20),
+ limit_of_uses int UNSIGNED,
+ number_of_uses int UNSIGNED NOT NULL DEFAULT 0
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
ALTER TABLE cookies
ADD PRIMARY KEY (id),
ADD UNIQUE KEY device_token (device_token(512)),
@@ -368,6 +379,11 @@
ALTER TABLE message_search
ADD PRIMARY KEY (original_message_id),
ADD FULLTEXT INDEX processed_content (processed_content);
+
+ ALTER TABLE invite_links
+ ADD PRIMARY KEY (id),
+ ADD UNIQUE KEY (name),
+ ADD INDEX community_primary (community, \`primary\`);
`,
{ multipleStatements: true },
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 30, 8:42 AM (11 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5866763
Default Alt Text
D7519.1767084126.diff (2 KB)
Attached To
Mode
D7519: [keyserver] Create a table for invite links
Attached
Detach File
Event Timeline
Log In to Comment