Blogs.BlogId was a one-time copy of BlogNames and nothing kept it current: 12,238 blogs first seen after 2026-08-07 had a BlogNames ID but a NULL Blogs.BlogId, so GetBlogs' join on BlogId silently skipped them and their 23,148 notes. - retire-blognames.sql: stub Blogs rows for the 17 unregistered note participants, backfill IDs (none renumbered), make ix_Blogs_BlogId UNIQUE, drop BlogNames, and add triggers that stop a Blogs row with a BlogId from being deleted, renamed or renumbered - AddNote registers both blogs via RegisterBlog (Blogs row + MAX+1 ID) and every query resolves names through Blogs instead of BlogNames - verify-db-schema.sql reports a DB that still has BlogNames (1e) - Update TL.db.md, AGENTS.md and the DB Browser saved queries Co-Authored-By: Claude Opus 5.5 <[email protected]>
31 lines
1.7 KiB
XML
31 lines
1.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="" readonly="1" foreign_keys="" case_sensitive_like="" temp_store="" wal_autocheckpoint="" synchronous=""/><attached/><window><main_tabs open="structure browser pragmas query" current="3"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="100"/><column_width id="3" width="3571"/><column_width id="4" width="0"/></tab_structure><tab_browse><table title="." custom_title="0" dock_id="4" table="0,0:"/><dock_state state="000000ff00000000fd0000000100000002000005f40000030ffc0100000002fb000000160064006f0063006b00420072006f00770073006500310100000000000005f40000000000000000fb000000160064006f0063006b00420072006f00770073006500340100000000ffffffff0000011700ffffff000005f40000000000000004000000040000000800000008fc00000000"/><default_encoding codec=""/><browse_table_settings/></tab_browse><tab_sql><sql name="SQL 1">SELECT
|
|
BlogName || '.tumblr.com/post/' || postID,
|
|
|
|
datetime(NotesGatheredDateTime, 'unixepoch'), *
|
|
FROM
|
|
Posts
|
|
WHERE
|
|
NotesGatheredDateTime <> 0
|
|
ORDER BY
|
|
postdate desc</sql><sql name="SQL 2*">SELECT
|
|
datetime(TimeStamp, 'unixepoch'),
|
|
rbn.BlogName || '.tumblr.com/post/' || N.postid,
|
|
*,
|
|
nbn.BlogName || '.tumblr.com'
|
|
FROM
|
|
Notes N
|
|
inner JOIN
|
|
Blogs rbn on rbn.BlogId = N.RootBlogId
|
|
inner JOIN
|
|
Blogs nbn on nbn.BlogId = N.NoteBlogId
|
|
inner JOIN
|
|
NoteTypes t on t.TypeId = N.TypeId
|
|
inner JOIN
|
|
Posts P on P.PostID = N.PostID and P.BlogName = rbn.BlogName
|
|
WHERE rbn.BlogName NOT IN ('xlittle-ghost', 'glimmerin-darlin', 'vvenus-child')
|
|
and t.Type like 'r%'
|
|
and rbn.BlogName = 'zomb-eh'
|
|
and P.HasImage = 1
|
|
ORDER BY
|
|
TimeStamp desc</sql><current_tab id="1"/></tab_sql></sqlb_project>
|