{"action":"created","issue":{"url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/26","repository_url":"https://api.github.com/repos/j3k0/ganomede-notifications","labels_url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/26/comments","events_url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/26/events","html_url":"https://github.com/j3k0/ganomede-notifications/pull/26","id":148965359,"number":26,"title":"Single token per type:device","user":{"login":"elmigranto","id":886388,"avatar_url":"https://avatars.githubusercontent.com/u/886388?v=3","gravatar_id":"","url":"https://api.github.com/users/elmigranto","html_url":"https://github.com/elmigranto","followers_url":"https://api.github.com/users/elmigranto/followers","following_url":"https://api.github.com/users/elmigranto/following{/other_user}","gists_url":"https://api.github.com/users/elmigranto/gists{/gist_id}","starred_url":"https://api.github.com/users/elmigranto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elmigranto/subscriptions","organizations_url":"https://api.github.com/users/elmigranto/orgs","repos_url":"https://api.github.com/users/elmigranto/repos","events_url":"https://api.github.com/users/elmigranto/events{/privacy}","received_events_url":"https://api.github.com/users/elmigranto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-17T15:56:59Z","updated_at":"2016-04-19T06:57:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/j3k0/ganomede-notifications/pulls/26","html_url":"https://github.com/j3k0/ganomede-notifications/pull/26","diff_url":"https://github.com/j3k0/ganomede-notifications/pull/26.diff","patch_url":"https://github.com/j3k0/ganomede-notifications/pull/26.patch"},"body":"Closes #25 "},"comment":{"url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/comments/211761079","html_url":"https://github.com/j3k0/ganomede-notifications/pull/26#issuecomment-211761079","issue_url":"https://api.github.com/repos/j3k0/ganomede-notifications/issues/26","id":211761079,"user":{"login":"j3k0","id":191881,"avatar_url":"https://avatars.githubusercontent.com/u/191881?v=3","gravatar_id":"","url":"https://api.github.com/users/j3k0","html_url":"https://github.com/j3k0","followers_url":"https://api.github.com/users/j3k0/followers","following_url":"https://api.github.com/users/j3k0/following{/other_user}","gists_url":"https://api.github.com/users/j3k0/gists{/gist_id}","starred_url":"https://api.github.com/users/j3k0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j3k0/subscriptions","organizations_url":"https://api.github.com/users/j3k0/orgs","repos_url":"https://api.github.com/users/j3k0/repos","events_url":"https://api.github.com/users/j3k0/events{/privacy}","received_events_url":"https://api.github.com/users/j3k0/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T06:57:41Z","updated_at":"2016-04-19T06:57:41Z","body":"> To upgrade redis, run DB_FROM=X DB_TO=Y coffee src/push-api/token-storage.coffee\r\n\r\nFrom what I understand, this will make a backup of `DB_FROM` to `DB_TO` and upgrade `DB_FROM`.\r\n\r\nNaive update procedure:\r\n\r\n 1. stop `notification/v1` server modules + workers\r\n 2. run the database upgrade\r\n 3. upgrade notification/v1 server modules to latest + workers\r\n 4. restart the services.\r\n\r\nIssue with that:\r\n * downtime\r\n * can't rollback easily\r\n\r\nSo I have some questions:\r\n * Can I let the older version notification module version running while doing the database upgrade?\r\n   * If I let the notification module running, it'll keep registering tokens in the older format, that may not be upgraded... That's a little downside (those people will get notifications only after next app restart).\r\n   * Is there any issues of having the older format notifications tokens lying around in the DB?\r\n\r\nSo there's another option..\r\n\r\n1. upgrade and restart server modules and workers first (without downtime).\r\n2. run the database upgrade (while keeping server modules running).\r\n\r\nIf it is possible not to remove the older tokens from DB, I can rollback if something went wrong with the server update. If not, remove them as a second step.\r\n\r\nI'd love a flow like that:\r\n\r\n1. upgrade + restart server instances\r\n2. upgrade database (which keeps both old format and new format)\r\n3. cleanup old token keys\r\n\r\nIs that easy and possible?"}}