Improve DB Schema (#1896)
Improve DB Schema (#1896)

* Add missing indexes to DB

gym.last_scanned

gymmember.last_scanned
gymmember.pokemon_uid

gympokemon.trainer_name

pokestop.last_updated             <-- included already but not done during DB schema upgrade?
pokestop.active_fort_modifier

spawnpointdetectiondata.spawnpoint_id

token.last_updated

* Add initial migration step

* Use SmallIntegerField instead of IntegerField when possible
- IntegerField is way too large for most columns
- tinyint isn't available in peewee so use smallint for most columns

* Add data type migration step

* Comment out the pokestop.last_updated index for now (already there)
It was missing in my database and I migrated my DB from like version 5?
Maybe it was missing in some previous migration steps. Have to clarify...

* Make travis happy

* Revert "Make travis happy"

This reverts commit 589254e5fe0b30e580ce675618d68d20796676f1.

* Add pokestop.last_updated index if it doesn't exist
It looks like it's missing in some older databases. Probably missing in some migration step.

* bugged me

JapuDCret/RocketMap-Do,sclo012/PokemonGo-Map,RocketMap/RocketMap,djfye/PokemonGo-Map,RocketMap/RocketMap,birdstream/RocketMap,KoertJanssens/MasterBall.be,Alderon86/RocketMap,neskk/PokemonGo-Map,dev042/RocketMap,tomballgithub/RocketMap,ultrafunkamsterdam/PokemonGo-Map,rpotpogo/PokemonGo-Map,AEtHeLsYn/RocketMap,JapuDCret/RocketMap-Do,houkop/PokemonGo-Map,rpotpogo/PokemonGo-Map,hubertokf/RocketMap,boby361/RocketMap,sebastienvercammen/RocketMap,djfye/RocketMap,sclo012/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map,dev042/RocketMap,boby361/RocketMap,pkgta1/shuffle,Alderon86/RocketMap,KoertJanssens/MasterBall.be,birdstream/RocketMap,neskk/RocketMap,djfye/PokemonGo-Map,RocketMap/RocketMap,JapuDCret/RocketMap-Do,pgandev/RocketMap,pgandev/RocketMap,AEtHeLsYn/RocketMap,neskk/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map,neskk/PokemonGo-Map,sclo012/PokemonGo-Map,ultrafunkamsterdam/PokemonGo-Map,mpw1337/RocketMap,Alderon86/RocketMap,boby361/RocketMap,DennyLoko/RocketMap,DennyLoko/RocketMap,dev042/RocketMap,pgandev/RocketMap,DennyLoko/RocketMap,AEtHeLsYn/RocketMap,neskk/RocketMap,DennyLoko/RocketMap,HowDoesExcelWork/RocketMap,RocketMap/RocketMap,Alderon86/RocketMap,djfye/PokemonGo-Map,birdstream/RocketMap,boby361/RocketMap,hubertokf/RocketMap,neskk/PokemonGo-Map,neskk/RocketMap,tomballgithub/RocketMap,djfye/RocketMap,hubertokf/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,pkgta1/shuffle,HowDoesExcelWork/RocketMap,mpw1337/RocketMap,JapuDCret/RocketMap-Do,voxx/RocketMap,voxx/RocketMap,pkgta1/shuffle,djfye/RocketMap,mpw1337/RocketMap,birdstream/RocketMap,slgphantom/RocketMap,voxx/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,mpw1337/RocketMap,houkop/PokemonGo-Map,hubertokf/RocketMap,sebastienvercammen/RocketMap,KoertJanssens/MasterBall.be,tomballgithub/RocketMap,rpotpogo/PokemonGo-Map,pgandev/RocketMap,djfye/PokemonGo-Map,sebastienvercammen/RocketMap,djfye/RocketMap,dev042/RocketMap,KoertJanssens/MasterBall.be,sclo012/PokemonGo-Map,houkop/PokemonGo-Map,pkgta1/shuffle,slgphantom/RocketMap,AEtHeLsYn/RocketMap,sebastienvercammen/RocketMap,slgphantom/RocketMap,neskk/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,slgphantom/RocketMap,houkop/PokemonGo-Map,tomballgithub/RocketMap,voxx/RocketMap,HowDoesExcelWork/RocketMap,HowDoesExcelWork/RocketMap,ultrafunkamsterdam/PokemonGo-Map-V2,rpotpogo/PokemonGo-Map