Closed critzo closed 4 years ago
Looked into this, and just to summarize:
library_networks
database table. In the models we delete and recreate modified rows as part of a transaction during an update, because for a PUT
operation the standardized behavior is for it to take the entire object being updated (because a PUT
is supposed to be idempotent) and update the object if it exists, returning in our case a 204
response. If the object does not exist, then it is supposed to create the object and return a 201
. We delete the row and recreate it to avoid a possible collision if the row exists, but this introduces a problem with foreign keys, which don't like to have the entry they're referencing deleted. Consequently, we set our join tables to have cascading deletes and updates, so that the database server handles it all transparently and internally. However, the library_networks
table is currently not set to cascade.To sum up, the tasks are:
onDelete()
and onUpdate()
CASCADE to the library_networks
table, see other join table migrations for the syntax.
When attempting to add edit the timezone field in the "Library", setting it to any value produces this error:
I would like to add something like "America/Boise"
This field also could/should be a dropdown or autocomplete field with a list of known timezones.