3 ms·
This makes querying harder. You cannot use “is not null” or “= true” for where clauses with this. You’ll need to parse the string value. When going the explici
by vbsteven 5y ago
This makes querying harder. You cannot use “is not null” or “= true” for where clauses with this. You’ll need to parse the string value.
When going the explicit route I would recommend an is_archived (nullable) bool column combined with an archived_at timestamp column.
- bachmeier 5y agoIf you're using sqlite, for instance, you can call the substr function (I was sticking with the article's constraint to not add a new column). There is one thing in favor of storing the full history in a single string - you might not query the full history very often, and you can keep a lot of information around without adding another table. I've occasionally stored the full history of objects (short notes mostly) in an sqlite database as a string in json form. Pretty convenient if you're keeping it there just in case you want to go back in time and don't make a large number of changes.
- d0100 5y agoAt this point just create a archived_resources table where you store the resource id, timestamp and user id