- Add metadata to entries when they're created via Micropub.
- Resolve
authorinto h-cards when rendering entries.
Migration:
UPDATEmicroformats2SETcontent=json_set(content,'$.properties.url',COALESCE(json_extract(content,'$.properties.url'),json_extract(content,'$.properties.uid')),'$.properties.published',COALESCE(json_extract(content,'$.properties.published'),json_array(strftime('%Y-%m-%dT%H:%M:%SZ',created_at))),'$.properties.author',COALESCE(json_extract(content,'$.properties.author'),json_array(author)))WHEREauthor='https://robida.net'ANDjson_extract(content,'$.type[0]')='h-entry'AND(json_extract(content,'$.properties.url')ISNULLORjson_extract(content,'$.properties.published')ISNULLORjson_extract(content,'$.properties.author')ISNULL);-- Optionally: Backfill updated for entries that have been modified
UPDATEmicroformats2SETcontent=json_set(content,'$.properties.updated',json_array(strftime('%Y-%m-%dT%H:%M:%SZ',updated_at)))WHEREauthor='https://robida.net'ANDjson_extract(content,'$.type[0]')='h-entry'ANDupdated_atISNOTNULLANDupdated_at!=created_atANDjson_extract(content,'$.properties.updated')ISNULL;
- Add metadata to entries when they're created via Micropub.
- Resolve `author` into h-cards when rendering entries.
Migration:
```sql
UPDATE microformats2
SET content = json_set(
content,
'$.properties.url',
COALESCE(
json_extract(content, '$.properties.url'),
json_extract(content, '$.properties.uid')
),
'$.properties.published',
COALESCE(
json_extract(content, '$.properties.published'),
json_array(strftime('%Y-%m-%dT%H:%M:%SZ', created_at))
),
'$.properties.author',
COALESCE(
json_extract(content, '$.properties.author'),
json_array(author)
)
)
WHERE
author = 'https://robida.net'
AND json_extract(content, '$.type[0]') = 'h-entry'
AND (
json_extract(content, '$.properties.url') IS NULL
OR json_extract(content, '$.properties.published') IS NULL
OR json_extract(content, '$.properties.author') IS NULL
);
-- Optionally: Backfill updated for entries that have been modified
UPDATE microformats2
SET content = json_set(
content,
'$.properties.updated',
json_array(strftime('%Y-%m-%dT%H:%M:%SZ', updated_at))
)
WHERE
author = 'https://robida.net'
AND json_extract(content, '$.type[0]') = 'h-entry'
AND updated_at IS NOT NULL
AND updated_at != created_at
AND json_extract(content, '$.properties.updated') IS NULL;
```