{"action":"opened","number":1896,"pull_request":{"url":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896","id":108657382,"html_url":"https://github.com/RocketMap/RocketMap/pull/1896","diff_url":"https://github.com/RocketMap/RocketMap/pull/1896.diff","patch_url":"https://github.com/RocketMap/RocketMap/pull/1896.patch","issue_url":"https://api.github.com/repos/RocketMap/RocketMap/issues/1896","number":1896,"state":"open","locked":false,"title":"Improve DB Schema","user":{"login":"Obihoernchen","id":453508,"avatar_url":"https://avatars0.githubusercontent.com/u/453508?v=3","gravatar_id":"","url":"https://api.github.com/users/Obihoernchen","html_url":"https://github.com/Obihoernchen","followers_url":"https://api.github.com/users/Obihoernchen/followers","following_url":"https://api.github.com/users/Obihoernchen/following{/other_user}","gists_url":"https://api.github.com/users/Obihoernchen/gists{/gist_id}","starred_url":"https://api.github.com/users/Obihoernchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Obihoernchen/subscriptions","organizations_url":"https://api.github.com/users/Obihoernchen/orgs","repos_url":"https://api.github.com/users/Obihoernchen/repos","events_url":"https://api.github.com/users/Obihoernchen/events{/privacy}","received_events_url":"https://api.github.com/users/Obihoernchen/received_events","type":"User","site_admin":false},"body":"## Description\r\n_Please don't merge yet. Further testing needed._\r\n\r\nThis PR improves the current DB schema. It adds some missing indexes and changes some int columns to smallint to save some space.\r\n\r\nThis will add missing indexes to the following columns:\r\n- gym.last_scanned\r\n- gymmember.last_scanned\r\n- gymmember.pokemon_uid\r\n- gympokemon.trainer_name\r\n- ~~pokestop.last_updated~~\r\n  - included already but my DB missed it (very old DB, maybe missed in previous migration steps)?\r\n  - If you have an older DB can you check whether you have this index in your DB please?\r\n- pokestop.active_fort_modifier\r\n- spawnpointdetectiondata.spawnpoint_id\r\n- token.last_updated\r\n\r\nFurthermore the following columns were changed from int to smallint, because that's more than sufficient:\r\n```\r\npokemon\r\n    pokemon_id\r\n    individual_attack\r\n    individual_defense\r\n    individual_stamina\r\n    move_1\r\n    move_2\r\n\t\t\r\ngym\r\n    team_id\r\n    guard_pokemon_id\r\n\t\r\nscannedlocation\r\n    band1\r\n    band2\r\n    band3\r\n    band4\r\n    band5\r\n    midpoint\r\n    width\r\n\t\t\t\t\r\nspawnpoint\r\n    latest_seen\r\n    earliest_unseen\r\n\r\nspawnpointdetectiondata\r\n    tth_secs\r\n\r\nversions\r\n    val\r\n\r\ngympokemon\r\n    pokemon_id\r\n    cp\r\n    num_upgrades\r\n    move_1\r\n    move_2\r\n    stamina\r\n    stamina_max\r\n    iv_defense\r\n    iv_stamina\r\n    iv_attack\r\n\t\t\t\r\ntrainer\r\n    team\r\n    level\r\n```\r\n\r\n## Motivation and Context\r\nmissing indexes are bad and I saw that int is unnecessary\r\n\r\n## How Has This Been Tested?\r\ntest map with mysql and sqlite\r\n\r\n## Screenshots:\r\nI added message because this DB schema upgrade can take some time:\r\n```\r\n2017-03-02 00:56:47,683 [      MainThread][        models][    INFO] Detected database version 15, updating to 16...\r\n2017-03-02 00:56:47,683 [      MainThread][        models][    INFO] This DB schema update can take some minutes. Please be patient.\r\n```\r\n\r\n## Types of changes\r\n- [X] Bug fix (non-breaking change which fixes an issue)\r\n\r\n## Checklist:\r\n- [X] My code follows the code style of this project.","created_at":"2017-03-01T23:58:41Z","updated_at":"2017-03-01T23:58:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896/commits","review_comments_url":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896/comments","review_comment_url":"https://api.github.com/repos/RocketMap/RocketMap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RocketMap/RocketMap/issues/1896/comments","statuses_url":"https://api.github.com/repos/RocketMap/RocketMap/statuses/214f78ad05335a929af08fa3353e4670f38daffb","head":{"label":"Obihoernchen:db-schema","ref":"db-schema","sha":"214f78ad05335a929af08fa3353e4670f38daffb","user":{"login":"Obihoernchen","id":453508,"avatar_url":"https://avatars0.githubusercontent.com/u/453508?v=3","gravatar_id":"","url":"https://api.github.com/users/Obihoernchen","html_url":"https://github.com/Obihoernchen","followers_url":"https://api.github.com/users/Obihoernchen/followers","following_url":"https://api.github.com/users/Obihoernchen/following{/other_user}","gists_url":"https://api.github.com/users/Obihoernchen/gists{/gist_id}","starred_url":"https://api.github.com/users/Obihoernchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Obihoernchen/subscriptions","organizations_url":"https://api.github.com/users/Obihoernchen/orgs","repos_url":"https://api.github.com/users/Obihoernchen/repos","events_url":"https://api.github.com/users/Obihoernchen/events{/privacy}","received_events_url":"https://api.github.com/users/Obihoernchen/received_events","type":"User","site_admin":false},"repo":{"id":67551671,"name":"RocketMap","full_name":"Obihoernchen/RocketMap","owner":{"login":"Obihoernchen","id":453508,"avatar_url":"https://avatars0.githubusercontent.com/u/453508?v=3","gravatar_id":"","url":"https://api.github.com/users/Obihoernchen","html_url":"https://github.com/Obihoernchen","followers_url":"https://api.github.com/users/Obihoernchen/followers","following_url":"https://api.github.com/users/Obihoernchen/following{/other_user}","gists_url":"https://api.github.com/users/Obihoernchen/gists{/gist_id}","starred_url":"https://api.github.com/users/Obihoernchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Obihoernchen/subscriptions","organizations_url":"https://api.github.com/users/Obihoernchen/orgs","repos_url":"https://api.github.com/users/Obihoernchen/repos","events_url":"https://api.github.com/users/Obihoernchen/events{/privacy}","received_events_url":"https://api.github.com/users/Obihoernchen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Obihoernchen/RocketMap","description":"🌏 Live visualization of all the pokemon in your area... and more!","fork":true,"url":"https://api.github.com/repos/Obihoernchen/RocketMap","forks_url":"https://api.github.com/repos/Obihoernchen/RocketMap/forks","keys_url":"https://api.github.com/repos/Obihoernchen/RocketMap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Obihoernchen/RocketMap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Obihoernchen/RocketMap/teams","hooks_url":"https://api.github.com/repos/Obihoernchen/RocketMap/hooks","issue_events_url":"https://api.github.com/repos/Obihoernchen/RocketMap/issues/events{/number}","events_url":"https://api.github.com/repos/Obihoernchen/RocketMap/events","assignees_url":"https://api.github.com/repos/Obihoernchen/RocketMap/assignees{/user}","branches_url":"https://api.github.com/repos/Obihoernchen/RocketMap/branches{/branch}","tags_url":"https://api.github.com/repos/Obihoernchen/RocketMap/tags","blobs_url":"https://api.github.com/repos/Obihoernchen/RocketMap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Obihoernchen/RocketMap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Obihoernchen/RocketMap/git/refs{/sha}","trees_url":"https://api.github.com/repos/Obihoernchen/RocketMap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Obihoernchen/RocketMap/statuses/{sha}","languages_url":"https://api.github.com/repos/Obihoernchen/RocketMap/languages","stargazers_url":"https://api.github.com/repos/Obihoernchen/RocketMap/stargazers","contributors_url":"https://api.github.com/repos/Obihoernchen/RocketMap/contributors","subscribers_url":"https://api.github.com/repos/Obihoernchen/RocketMap/subscribers","subscription_url":"https://api.github.com/repos/Obihoernchen/RocketMap/subscription","commits_url":"https://api.github.com/repos/Obihoernchen/RocketMap/commits{/sha}","git_commits_url":"https://api.github.com/repos/Obihoernchen/RocketMap/git/commits{/sha}","comments_url":"https://api.github.com/repos/Obihoernchen/RocketMap/comments{/number}","issue_comment_url":"https://api.github.com/repos/Obihoernchen/RocketMap/issues/comments{/number}","contents_url":"https://api.github.com/repos/Obihoernchen/RocketMap/contents/{+path}","compare_url":"https://api.github.com/repos/Obihoernchen/RocketMap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Obihoernchen/RocketMap/merges","archive_url":"https://api.github.com/repos/Obihoernchen/RocketMap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Obihoernchen/RocketMap/downloads","issues_url":"https://api.github.com/repos/Obihoernchen/RocketMap/issues{/number}","pulls_url":"https://api.github.com/repos/Obihoernchen/RocketMap/pulls{/number}","milestones_url":"https://api.github.com/repos/Obihoernchen/RocketMap/milestones{/number}","notifications_url":"https://api.github.com/repos/Obihoernchen/RocketMap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Obihoernchen/RocketMap/labels{/name}","releases_url":"https://api.github.com/repos/Obihoernchen/RocketMap/releases{/id}","deployments_url":"https://api.github.com/repos/Obihoernchen/RocketMap/deployments","created_at":"2016-09-06T22:33:33Z","updated_at":"2017-02-04T12:43:22Z","pushed_at":"2017-03-01T23:43:47Z","git_url":"git://github.com/Obihoernchen/RocketMap.git","ssh_url":"git@github.com:Obihoernchen/RocketMap.git","clone_url":"https://github.com/Obihoernchen/RocketMap.git","svn_url":"https://github.com/Obihoernchen/RocketMap","homepage":"","size":29619,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"RocketMap:develop","ref":"develop","sha":"b161102d946a44ff900cf61ca3e038894dcd7179","user":{"login":"RocketMap","id":20848202,"avatar_url":"https://avatars0.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketMap","html_url":"https://github.com/RocketMap","followers_url":"https://api.github.com/users/RocketMap/followers","following_url":"https://api.github.com/users/RocketMap/following{/other_user}","gists_url":"https://api.github.com/users/RocketMap/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketMap/subscriptions","organizations_url":"https://api.github.com/users/RocketMap/orgs","repos_url":"https://api.github.com/users/RocketMap/repos","events_url":"https://api.github.com/users/RocketMap/events{/privacy}","received_events_url":"https://api.github.com/users/RocketMap/received_events","type":"Organization","site_admin":false},"repo":{"id":64970925,"name":"RocketMap","full_name":"RocketMap/RocketMap","owner":{"login":"RocketMap","id":20848202,"avatar_url":"https://avatars0.githubusercontent.com/u/20848202?v=3","gravatar_id":"","url":"https://api.github.com/users/RocketMap","html_url":"https://github.com/RocketMap","followers_url":"https://api.github.com/users/RocketMap/followers","following_url":"https://api.github.com/users/RocketMap/following{/other_user}","gists_url":"https://api.github.com/users/RocketMap/gists{/gist_id}","starred_url":"https://api.github.com/users/RocketMap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RocketMap/subscriptions","organizations_url":"https://api.github.com/users/RocketMap/orgs","repos_url":"https://api.github.com/users/RocketMap/repos","events_url":"https://api.github.com/users/RocketMap/events{/privacy}","received_events_url":"https://api.github.com/users/RocketMap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RocketMap/RocketMap","description":"🌏 Live visualization of all the pokemon in your area... and more!","fork":false,"url":"https://api.github.com/repos/RocketMap/RocketMap","forks_url":"https://api.github.com/repos/RocketMap/RocketMap/forks","keys_url":"https://api.github.com/repos/RocketMap/RocketMap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RocketMap/RocketMap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RocketMap/RocketMap/teams","hooks_url":"https://api.github.com/repos/RocketMap/RocketMap/hooks","issue_events_url":"https://api.github.com/repos/RocketMap/RocketMap/issues/events{/number}","events_url":"https://api.github.com/repos/RocketMap/RocketMap/events","assignees_url":"https://api.github.com/repos/RocketMap/RocketMap/assignees{/user}","branches_url":"https://api.github.com/repos/RocketMap/RocketMap/branches{/branch}","tags_url":"https://api.github.com/repos/RocketMap/RocketMap/tags","blobs_url":"https://api.github.com/repos/RocketMap/RocketMap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RocketMap/RocketMap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RocketMap/RocketMap/git/refs{/sha}","trees_url":"https://api.github.com/repos/RocketMap/RocketMap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RocketMap/RocketMap/statuses/{sha}","languages_url":"https://api.github.com/repos/RocketMap/RocketMap/languages","stargazers_url":"https://api.github.com/repos/RocketMap/RocketMap/stargazers","contributors_url":"https://api.github.com/repos/RocketMap/RocketMap/contributors","subscribers_url":"https://api.github.com/repos/RocketMap/RocketMap/subscribers","subscription_url":"https://api.github.com/repos/RocketMap/RocketMap/subscription","commits_url":"https://api.github.com/repos/RocketMap/RocketMap/commits{/sha}","git_commits_url":"https://api.github.com/repos/RocketMap/RocketMap/git/commits{/sha}","comments_url":"https://api.github.com/repos/RocketMap/RocketMap/comments{/number}","issue_comment_url":"https://api.github.com/repos/RocketMap/RocketMap/issues/comments{/number}","contents_url":"https://api.github.com/repos/RocketMap/RocketMap/contents/{+path}","compare_url":"https://api.github.com/repos/RocketMap/RocketMap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RocketMap/RocketMap/merges","archive_url":"https://api.github.com/repos/RocketMap/RocketMap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RocketMap/RocketMap/downloads","issues_url":"https://api.github.com/repos/RocketMap/RocketMap/issues{/number}","pulls_url":"https://api.github.com/repos/RocketMap/RocketMap/pulls{/number}","milestones_url":"https://api.github.com/repos/RocketMap/RocketMap/milestones{/number}","notifications_url":"https://api.github.com/repos/RocketMap/RocketMap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RocketMap/RocketMap/labels{/name}","releases_url":"https://api.github.com/repos/RocketMap/RocketMap/releases{/id}","deployments_url":"https://api.github.com/repos/RocketMap/RocketMap/deployments","created_at":"2016-08-04T22:18:49Z","updated_at":"2017-03-01T21:29:01Z","pushed_at":"2017-03-01T23:54:24Z","git_url":"git://github.com/RocketMap/RocketMap.git","ssh_url":"git@github.com:RocketMap/RocketMap.git","clone_url":"https://github.com/RocketMap/RocketMap.git","svn_url":"https://github.com/RocketMap/RocketMap","homepage":"","size":29483,"stargazers_count":2656,"watchers_count":2656,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1578,"mirror_url":null,"open_issues_count":187,"forks":1578,"open_issues":187,"watchers":2656,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896"},"html":{"href":"https://github.com/RocketMap/RocketMap/pull/1896"},"issue":{"href":"https://api.github.com/repos/RocketMap/RocketMap/issues/1896"},"comments":{"href":"https://api.github.com/repos/RocketMap/RocketMap/issues/1896/comments"},"review_comments":{"href":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896/comments"},"review_comment":{"href":"https://api.github.com/repos/RocketMap/RocketMap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RocketMap/RocketMap/pulls/1896/commits"},"statuses":{"href":"https://api.github.com/repos/RocketMap/RocketMap/statuses/214f78ad05335a929af08fa3353e4670f38daffb"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":5,"additions":119,"deletions":39,"changed_files":1}}
{"actor":{"display_login":"Obihoernchen"}}