{"action":"closed","issue":{"url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/378","repository_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql","labels_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/378/comments","events_url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/issues/378/events","html_url":"https://github.com/mozilla/fxa-auth-db-mysql/issues/378","id":343690258,"node_id":"MDU6SXNzdWUzNDM2OTAyNTg=","number":378,"title":"Pull sessionToken out of the devices table","user":{"login":"eoger","id":6424575,"node_id":"MDQ6VXNlcjY0MjQ1NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6424575?v=4","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false},"labels":[{"id":241442549,"node_id":"MDU6TGFiZWwyNDE0NDI1NDk=","url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/labels/waffle:backlog","name":"waffle:backlog","color":"ededed","default":false},{"id":241442548,"node_id":"MDU6TGFiZWwyNDE0NDI1NDg=","url":"https://api.github.com/repos/mozilla/fxa-auth-db-mysql/labels/waffle:next","name":"waffle:next","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"rfk","id":34695,"node_id":"MDQ6VXNlcjM0Njk1","avatar_url":"https://avatars3.githubusercontent.com/u/34695?v=4","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},"assignees":[{"login":"rfk","id":34695,"node_id":"MDQ6VXNlcjM0Njk1","avatar_url":"https://avatars3.githubusercontent.com/u/34695?v=4","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},{"login":"vladikoff","id":128755,"node_id":"MDQ6VXNlcjEyODc1NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/128755?v=4","gravatar_id":"","url":"https://api.github.com/users/vladikoff","html_url":"https://github.com/vladikoff","followers_url":"https://api.github.com/users/vladikoff/followers","following_url":"https://api.github.com/users/vladikoff/following{/other_user}","gists_url":"https://api.github.com/users/vladikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vladikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladikoff/subscriptions","organizations_url":"https://api.github.com/users/vladikoff/orgs","repos_url":"https://api.github.com/users/vladikoff/repos","events_url":"https://api.github.com/users/vladikoff/events{/privacy}","received_events_url":"https://api.github.com/users/vladikoff/received_events","type":"User","site_admin":false},{"login":"eoger","id":6424575,"node_id":"MDQ6VXNlcjY0MjQ1NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/6424575?v=4","gravatar_id":"","url":"https://api.github.com/users/eoger","html_url":"https://github.com/eoger","followers_url":"https://api.github.com/users/eoger/followers","following_url":"https://api.github.com/users/eoger/following{/other_user}","gists_url":"https://api.github.com/users/eoger/gists{/gist_id}","starred_url":"https://api.github.com/users/eoger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoger/subscriptions","organizations_url":"https://api.github.com/users/eoger/orgs","repos_url":"https://api.github.com/users/eoger/repos","events_url":"https://api.github.com/users/eoger/events{/privacy}","received_events_url":"https://api.github.com/users/eoger/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-07-23T15:47:45Z","updated_at":"2018-08-21T19:12:36Z","closed_at":"2018-08-21T19:12:36Z","author_association":"CONTRIBUTOR","body":"In the OAuth world, devices will not only be associated with a session token anymore.\r\nThis is why we should pull the `sessionTokenId` column out of the `devices` table and create a 1:1 `deviceId`: `sessionTokenId` table.\r\nSince it's a big migration, we should probably do it in multiple steps just like we did with the `utf8mb4` display names:\r\n1. Create the `devicesSessionTokens` table. Modify the queries to double write `sessionTokenId` both in the `devices` table and in this new table.\r\n2. Run a procedure to create the remaining `devicesSessionTokens` rows for devices which haven't been updated since step 1.\r\n3. Update the read/write queries to only use `devicesSessionTokens`.\r\n4. Remove the `sessionTokenId` column from `devices`.\r\n\r\n@rfk does that sound like a good plan to you?"}}
{"actor":{"display_login":"vladikoff"}}