Page MenuHomePhabricator

[keyserver] introduce a table for communities
ClosedPublic

Authored by ginsu on May 6 2024, 6:48 AM.
Tags
None
Referenced Files
F3303133: D11903.diff
Mon, Nov 18, 10:31 AM
Unknown Object (File)
Tue, Nov 12, 8:43 AM
Unknown Object (File)
Mon, Nov 11, 5:43 AM
Unknown Object (File)
Sun, Nov 10, 7:37 PM
Unknown Object (File)
Sun, Nov 10, 7:32 PM
Unknown Object (File)
Sun, Nov 10, 11:42 AM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Unknown Object (File)
Fri, Nov 8, 7:16 PM
Subscribers

Details

Summary

This new table will be used to store information about a community. For the scope of the project, I intentially made the schema for the table very limited + only focused on tagging a farcaster channel, and figured we could always alter the table in the future to include other things like invite links when I have more free cycles

Depends on D11894

Test Plan

Ran migration and confirmed the table was created. Also created a new db and confirmed that this also creates the communites table.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested review of this revision.May 6 2024, 7:08 AM
keyserver/src/database/migration-config.js
775–789 ↗(On Diff #39846)

Please follow our conventions for alligning these

tomek requested changes to this revision.May 7 2024, 2:04 AM
tomek added inline comments.
keyserver/src/database/migration-config.js
775–811 ↗(On Diff #39846)

We don't need to have two separate queries from selecting and inserting. It is more efficient to have a single query - the data won't go through the JS. Also, simpler code means that it's more maintainable. This would be more important for non-migration code, but I still think we should make this change.

This revision now requires changes to proceed.May 7 2024, 2:04 AM
keyserver/src/database/migration-config.js
775–811 ↗(On Diff #39846)

Makes sense! Agree this is a lot more simple + easier to understand

tomek added inline comments.
keyserver/src/database/migration-config.js
786–788 ↗(On Diff #39901)

Please update the indentation to match our conventions before landing.

keyserver/src/database/setup-db.js
478 ↗(On Diff #39901)

We have to remember that there should be created a row in the communities table for this thread.

This revision is now accepted and ready to land.May 8 2024, 2:47 AM
keyserver/src/database/setup-db.js
478 ↗(On Diff #39901)

Nuked my db, and confirmed that when i set up my db again, there was a row in the communities table for GENESIS