GameVersion version number should be an int
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MUGLE |
Fix Released
|
High
|
Prageeth Silva |
Bug Description
Currently, the GameVersion class's primary key pKey is a String, which is emulating a composite key built from the Game ID (int) and version number (string). This is a bit messy, but we have decided to keep this weird string composite key.
The bug is this: The "version number" part of the string is itself an arbitrary string. It should be an int. Thus, pKey is a string comprising two ints separated by a slash.
GameVersion's version parameter should have type int. getVersion should return an int.
The reason it was a string was to support version numbers such as "1.4.2". That is not the purpose of a primary key -- they should be sequential integers which developers have no control over (they simply increment each version). Outside the scope of this bug: add another field "version_string" which is a developer-
Related branches
Changed in mugle: | |
status: | Triaged → Fix Committed |
Changed in mugle: | |
milestone: | none → 0.1.1 |
Changed in mugle: | |
assignee: | Matt Giuca (mgiuca) → Prageeth Silva (prageethsilva) |
Changed in mugle: | |
status: | Fix Committed → Fix Released |
The GameVersion class now has a separate 'Integer version' field (which is persistent). This redundantly stores the version number (so a class might have pkey "42/12" and version 12). I thought we had agreed we would simply parse the integer out of the string, so it is not redundantly stored.
I'll change it so there is no explicit field 'version', and instead the getVersion method pulls the version number out of the string. Does anybody object to this change?