I am working on an app that will be cross-platform: web, android, iOS. I have a couple objects that are intended to specify some constants, like valid states. For example:
{
"states": {
"VALID": 0,
"INVALID": 1
}
}
Now I've released clients that use this object and they're out in the wild, but I realize this object doesn't meet my needs and it needs to change. Right now I've created a versioned object like this:
{
"states2": {
"VALID": {
"id": 0,
"name": "Valid entry"
},
"INVALID": {
"id": 1,
"name": "Invalid entry"
}
}
Right now the plan is to leave the states object, and just get the extra data from states2 in the newer clients, but this seems really terrible to leave that kind of legacy cruft around. So to the question:
1) Is there a way to version objects that Firebase provides?
or
2) Am I just using Firebase in a way it isn't meant to be used?
or
3) Is there a better way to structure this kind of read-only data in Firebase?