-
Notifications
You must be signed in to change notification settings - Fork 640
Remove the tokens
table
#1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the tokens
table
#1090
Conversation
462743a
to
a1475db
Compare
@carols10cents FYI I've got a branch updating to Diesel master (likely to represent 1.0 API-wise) ready to go, just blocked on this. Stuff like #1108 (and this, which is why I branched off this PR) will conflict heavily with it since we deprecated our existing APIs both for insert and upsert. I'm fine with keeping it up to date as you review other stuff, but just wanted to let you know where I'm at |
Sorry sorry sorry. We need #1108 out before the release on thursday, so I'm going to merge and deploy that, then look at this. |
Lol it's completely fine. No rush. Like I said, just wanted to let you know what's up |
This table was always one-to-one with the emails table, and we should have always been updating it when the email was updated. This moves all of that logic into the database, and merges the two tables. The only reason that these tables were ever separate as far as I can tell was to represent when the confirmation email hadn't been sent. However, we can just do that with a nullable column. However, having the `token` column leads to some awkward `unwrap`s in the code where we return it, since we know that updating the `email` always generates a new token. For that reason I have made the `token` column `NOT NULL`, but left the timestamp nullable. Rows in the `emails` table that did not previously have an associated `token` row will have a `NULL` value for this column.
a1475db
to
01bad8d
Compare
Phew, had a chance to look at this, looks good! Diesel upgrade away! bors: r+ |
1090: Remove the `tokens` table r=carols10cents This table was always one-to-one with the emails table, and we should have always been updating it when the email was updated. This moves all of that logic into the database, and merges the two tables. The only reason that these tables were ever separate as far as I can tell was to represent when the confirmation email hadn't been sent. However, we can just do that with a nullable column. However, having the `token` column leads to some awkward `unwrap`s in the code where we return it, since we know that updating the `email` always generates a new token. For that reason I have made the `token` column `NOT NULL`, but left the timestamp nullable. Rows in the `emails` table that did not previously have an associated `token` row will have a `NULL` value for this column.
<3
…On Mon, Oct 9, 2017, 7:16 PM Carol (Nichols || Goulding) < ***@***.***> wrote:
Phew, had a chance to look at this, looks good! Diesel upgrade away!
bors: r+
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1090 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABdWK8ekpOJMfysliC9QP_p4UrtIBsGOks5sqsVZgaJpZM4Pk9gk>
.
|
Build succeeded |
This table was always one-to-one with the emails table, and we should
have always been updating it when the email was updated. This moves all
of that logic into the database, and merges the two tables.
The only reason that these tables were ever separate as far as I can
tell was to represent when the confirmation email hadn't been sent.
However, we can just do that with a nullable column.
However, having the
token
column leads to some awkwardunwrap
s inthe code where we return it, since we know that updating the
email
always generates a new token. For that reason I have made the
token
column
NOT NULL
, but left the timestamp nullable. Rows in theemails
table that did not previously have an associated
token
row will have aNULL
value for this column.