Avoid SQL logic error in blob replication.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4340 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-07-07 12:08:14 +00:00
parent 5decdf3afa
commit 85b87553dd

View File

@ -174,13 +174,15 @@ void tf_ssb_db_init(tf_ssb_t* ssb)
_tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_refs_message_idx ON messages_refs (message)");
_tf_ssb_db_exec(db, "CREATE INDEX IF NOT EXISTS messages_refs_ref_idx ON messages_refs (ref)");
_tf_ssb_db_exec(db, "DROP VIEW IF EXISTS blob_wants_view");
_tf_ssb_db_exec(db,
"CREATE VIEW IF NOT EXISTS blob_wants_view (id) AS "
" SELECT messages_refs.ref AS id "
" FROM messages_refs "
" LEFT OUTER JOIN blobs ON messages_refs.ref = blobs.id "
" WHERE messages_refs.ref LIKE '&____________________________________________.sha256' "
" AND blobs.id IS NULL");
" WHERE blobs.id IS NULL "
" AND LENGTH(messages_refs.ref) = 52 "
" AND messages_refs.ref LIKE '&%.sha256'");
bool need_add_sequence_before_author = true;
bool need_convert_timestamp_to_real = false;