Page MenuHomePhabricator

[keyserver/sql] add SIWE columns
ClosedPublic

Authored by derek on Oct 20 2022, 8:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 18, 8:49 AM
Unknown Object (File)
Thu, May 16, 12:42 PM
Unknown Object (File)
Wed, May 8, 12:14 AM
Unknown Object (File)
Sun, May 5, 2:11 AM
Unknown Object (File)
Sun, May 5, 12:08 AM
Unknown Object (File)
Thu, May 2, 7:14 AM
Unknown Object (File)
Wed, May 1, 3:11 PM
Unknown Object (File)
Sat, Apr 27, 3:06 AM

Details

Summary

columns necessary for SIWE linear task

Test Plan

run keyserver, verify columns are in table with tableplus

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat's instructions here were to update setup-db.js *and* add a migration - correct me if i'm wrong, my understanding is if we modified setup-db.js we wouldn't need to add a migration

my understanding is if we modified setup-db.js we wouldn't need to add a migration

That understanding is wrong, setup-db.js only runs if there is no database.

@ashoat got it, i forgot that we're implicitly planning many new dbs to be created, as opposed to running migrations on a live sql instance.

also, i was extrapolating from postgres: my assumption was setup-db.js was effectively the OG schema that you see when you dump the db, & if you modified that OG record all following migrations would be corrupted.

added properties to db setup as well

i forgot that we're implicitly planning many new dbs to be created

also for updating developer local environment

tomek requested changes to this revision.Oct 21 2022, 2:53 AM
tomek added inline comments.
keyserver/src/database/migration-config.js
46 ↗(On Diff #17742)

Why do we use mediumtext type? What are the requirements for the content of this field?

keyserver/src/database/setup-db.js
36–38 ↗(On Diff #17742)

Do every row will have these values? Probably not and that would mean that adding these values to the table denormalizes the model. Ideally, we should have a separate table and a foreign key to that table, but it doesn't matter too much in this case and keeping this approach might be more cost effective. So let's keep it as it is simpler.

This revision now requires changes to proceed.Oct 21 2022, 2:53 AM
derek marked an inline comment as done.

updated column type

keyserver/src/database/migration-config.js
46 ↗(On Diff #17742)

linear task for context the goal is to use a key pair when authenticating for a social proof. i made it medium text because i was unsure of how long it would be. changed it to varchar(255)

keyserver/src/database/setup-db.js
36–38 ↗(On Diff #17742)

this task may add additional context/clarity around denormalization, but maybe we need to think more in depth about a separate table?

I think it makes sense in this table

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

We should investigate this a bit and determine what the expected length would be. It would be easier to have the right value from the beginning so that we don't need to update the type later.

This revision is now accepted and ready to land.Oct 21 2022, 8:29 AM
This revision was automatically updated to reflect the committed changes.
keyserver/src/database/migration-config.js
45

Agree with @tomek that we should research this... not clear that 255 is enough for public_key. Given this is landed already, if it's too short we'll need another migration...

46

Same here, not clear this is long enough