Page MenuHomePhabricator

[keyserver] Create a table for invite links
ClosedPublic

Authored by tomek on Apr 19 2023, 4:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 5:39 AM
Unknown Object (File)
Nov 8 2024, 11:43 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:26 AM
Unknown Object (File)
Oct 28 2024, 1:25 AM
Unknown Object (File)
Oct 28 2024, 1:18 AM
Unknown Object (File)
Oct 5 2024, 2:18 AM
Subscribers

Details

Summary

This new table will be used to store links and collect data about their usages.

Test Plan

Run migration and check if the table was created. Create a new db and check if that also creates this table.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Apr 19 2023, 4:39 AM
keyserver/src/database/migration-config.js
342 ↗(On Diff #25333)

What will expiration_status contain? Wondering why it's varchar(255)

347 ↗(On Diff #25333)

Does this UNIQUE here imply that there is only one link for a community?

tomek added inline comments.
keyserver/src/database/migration-config.js
342 ↗(On Diff #25333)

At some point the designs contained a list of expired links where the reason was present. One of the reasons that could be put here was manual expiration. But probably we shouldn't prioritize it - going to delete it for now, and if we ever decide to include it, we can do that.

347 ↗(On Diff #25333)

Yeah, the result is what you described. This is a mistake on my part, as this should be an ordinary index, and not the unique one. Furthermore, this index should also contain a primary flag as the second field, because it should support two queries: one for all the links from a community, and one for its primary link.

Fix the index and delete unnecessary field. Tested this change by droping a table and running the migration. I have to test creating a fresh db - going to do that before
landing.

This revision is now accepted and ready to land.Apr 21 2023, 7:03 AM
In D7519#224404, @tomek wrote:

Fix the index and delete unnecessary field. Tested this change by droping a table and running the migration. I have to test creating a fresh db - going to do that before
landing.

Confirmed that creating the fresh db creates the table correctly

This revision was automatically updated to reflect the committed changes.