Skip to content
Advertisement

Tag: database-schema

Query updated records in Database

Currently all our tables have a created_at and updated_at timestamp, e.g. The updated_at field is modified with every INSERT. This allows us to query all Cart’s which have been updated since a particular point in time with something like this: However this would not capture updates to FK relationships such as CartItemss and Users. Is there a nice way to

What’s best practice for normalisation of DB where a domain table has an “Other” option for free text?

I’m currently in the process of normalising a database for my company and one pattern I’m seeing a lot in this database is using a domain lookup table for a value but also allowing “Other” and storing the results in a separate column. My question is just whether there is perhaps a cleaner way of representing this? For context I’m

Advertisement