|
|
chanterelles with torchietti Tuesday, August 6 2024
Today I built out some functionality in the ESP8266 Remote Control system to permit "templating" the records of certain tables. When templated, those records are copied into the same table but given new primary keys and a tenant_id of zero. Once templated, these records can then be used to give new tenants (or restore to existing tenants) certain records that it would be good to have when first starting out. Such records might include device_types, management_rules, or even reports. I've built such templating systems in the past, but I'd always used separate template tables to hold the templates. But I'd been thinking about this for the past couple days and realized I could just use a fake tenant (one with an tenant_id of zero) to hold such templates in whatever tables could benefit from such a system. As part of building out such a system, I had to implement two utilities: one to copy well-curated records from a real tenant into the template tenant, and another to copy template records back to a real tenant. Doing so is not without its own problems, since non-templated tables refer to templated tables by foreign key, and these have a way of changing whenever records are copied from the template. So the preferred use for such a system is to gradually develop a good set of templates from working data but to only ever copy from the templates to a tenant before that tenant starts being used. Because if records are copied from the template to a working tenant, then someone also has to go through and fix all the broken foreign key relations. (But perhaps I can build a tool to do that too.)
This afternoon, I took Charlotte on a walk that was a shorter version of the walk we went on yesterday. I started on the Stick Trail and then cut over to the Chamomile Headwaters Trail prematurely. Once I was on that trail, I found a few chanterelles a little higher up than I normally find them, so I collected them and brought them home. This reminded me of all the uncooked chanterelles in the refrigerator. So I cooked them all up with onions and made a pot of Trader Joe's lemon-infused torchietti pasta (just because that shape kind of looks like a chanterelle) and ate all that with Rao's marinara sauce while Gretchen was heading out to her pilates class. My lupper of chanterelles with pasta was amazing!
For linking purposes this article's URL is: http://asecular.com/blog.php?240806 feedback previous | next |