Fossil SCM
Put a warning at the bottom of the /setup_chat page if FTS entries for chat are missing.
Commit
d5504f9deb324a85369da06d5457eb6d014e6f1a5ba5e878fe4bf3a0f543a202
Parent
43af043bd7e33e5…
1 file changed
+17
+17
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1652,10 +1652,27 @@ | ||
| 1652 | 1652 | @ <hr/> |
| 1653 | 1653 | @ <p><input type="submit" name="submit" value="Apply Changes"> |
| 1654 | 1654 | @ <input type="submit" name="rbldchatidx"\ |
| 1655 | 1655 | @ value="Rebuild Full-Text Search Index"></p> |
| 1656 | 1656 | @ </div></form> |
| 1657 | + | |
| 1658 | + /* Validate the chat FTS search index */ | |
| 1659 | + if( db_table_exists("repository","chatfts1") ){ | |
| 1660 | + char *zMissing; | |
| 1661 | + zMissing = db_text(0, | |
| 1662 | + "SELECT group_concat(rowid,', ') FROM chat" | |
| 1663 | + " WHERE rowid NOT IN (SELECT rowid FROM chatfts1_docsize)" | |
| 1664 | + ); | |
| 1665 | + if( zMissing && zMissing[0] ){ | |
| 1666 | + @ <p><b>WARNING:</b> The following chat messages are missing | |
| 1667 | + @ from the full-text index. Press the "Rebuild Full-Text Search Index" | |
| 1668 | + @ button above to fix this.</p> | |
| 1669 | + @ <p>%h(zMissing)</p> | |
| 1670 | + } | |
| 1671 | + fossil_free(zMissing); | |
| 1672 | + } | |
| 1673 | + | |
| 1657 | 1674 | db_end_transaction(0); |
| 1658 | 1675 | @ <script nonce="%h(style_nonce())"> |
| 1659 | 1676 | @ (function(){ |
| 1660 | 1677 | @ var w = document.getElementById('idsnd'); |
| 1661 | 1678 | @ w.onchange = function(){ |
| 1662 | 1679 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1652,10 +1652,27 @@ | |
| 1652 | @ <hr/> |
| 1653 | @ <p><input type="submit" name="submit" value="Apply Changes"> |
| 1654 | @ <input type="submit" name="rbldchatidx"\ |
| 1655 | @ value="Rebuild Full-Text Search Index"></p> |
| 1656 | @ </div></form> |
| 1657 | db_end_transaction(0); |
| 1658 | @ <script nonce="%h(style_nonce())"> |
| 1659 | @ (function(){ |
| 1660 | @ var w = document.getElementById('idsnd'); |
| 1661 | @ w.onchange = function(){ |
| 1662 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1652,10 +1652,27 @@ | |
| 1652 | @ <hr/> |
| 1653 | @ <p><input type="submit" name="submit" value="Apply Changes"> |
| 1654 | @ <input type="submit" name="rbldchatidx"\ |
| 1655 | @ value="Rebuild Full-Text Search Index"></p> |
| 1656 | @ </div></form> |
| 1657 | |
| 1658 | /* Validate the chat FTS search index */ |
| 1659 | if( db_table_exists("repository","chatfts1") ){ |
| 1660 | char *zMissing; |
| 1661 | zMissing = db_text(0, |
| 1662 | "SELECT group_concat(rowid,', ') FROM chat" |
| 1663 | " WHERE rowid NOT IN (SELECT rowid FROM chatfts1_docsize)" |
| 1664 | ); |
| 1665 | if( zMissing && zMissing[0] ){ |
| 1666 | @ <p><b>WARNING:</b> The following chat messages are missing |
| 1667 | @ from the full-text index. Press the "Rebuild Full-Text Search Index" |
| 1668 | @ button above to fix this.</p> |
| 1669 | @ <p>%h(zMissing)</p> |
| 1670 | } |
| 1671 | fossil_free(zMissing); |
| 1672 | } |
| 1673 | |
| 1674 | db_end_transaction(0); |
| 1675 | @ <script nonce="%h(style_nonce())"> |
| 1676 | @ (function(){ |
| 1677 | @ var w = document.getElementById('idsnd'); |
| 1678 | @ w.onchange = function(){ |
| 1679 |