Introduce an order column for version groups

Some code in spline-pokedex orders by `id`, which has worse consequences
than it may seem (e.g. instead of defaulting to most recent games, the
comparifier defaults to XD). This is the first step to fixing that.
This commit is contained in:
Petr Viktorin 2012-01-30 14:09:05 +01:00
parent 3607b9b3e1
commit 1134415e13
2 changed files with 16 additions and 14 deletions

View file

@ -1,14 +1,14 @@
id,generation_id,pokedex_id id,generation_id,pokedex_id,order
1,1,2 1,1,2,1
2,1,2 2,1,2,2
3,2,3 3,2,3,3
4,2,3 4,2,3,4
5,3,4 5,3,4,5
6,3,4 6,3,4,6
7,3,2 7,3,2,8
8,4,5 8,4,5,10
9,4,6 9,4,6,11
10,4,7 10,4,7,12
11,5,8 11,5,8,13
12,3,4 12,3,4,7
13,3,4 13,3,4,9

1 id generation_id pokedex_id order
2 1 1 2 1
3 2 1 2 2
4 3 2 3 3
5 4 2 3 4
6 5 3 4 5
7 6 3 4 6
8 7 3 2 8
9 8 4 5 10
10 9 4 6 11
11 10 4 7 12
12 11 5 8 13
13 12 3 4 7
14 13 3 4 9

View file

@ -1587,6 +1587,8 @@ class VersionGroup(TableBase):
info=dict(description=u"The ID of the generation the games in this group belong to.")) info=dict(description=u"The ID of the generation the games in this group belong to."))
pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), nullable=False, pokedex_id = Column(Integer, ForeignKey('pokedexes.id'), nullable=False,
info=dict(description=u"The ID of the regional Pokédex used in this version group.")) info=dict(description=u"The ID of the regional Pokédex used in this version group."))
order = Column(Integer, nullable=True,
info=dict(description=u"Order for sorting. Almost by date of release, except similar versions are grouped together."))
class VersionGroupRegion(TableBase): class VersionGroupRegion(TableBase):
u"""Maps a version group to a region that appears in it.""" u"""Maps a version group to a region that appears in it."""