This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Remove conflicting sqlite tables that are "reserved" (shadow fts4 tables) #9003
Merged
richvdh
merged 4 commits into
develop
from
8996-fix-sqlite-object-name-reserved-for-internal-use
Feb 10, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
36068ea
Remove conflicting sqlite tables that are "reserved"
MadLittleMods b2da205
Remove unwanted fts4 shadow tables when generating full schema
MadLittleMods 085c6e0
Update changelog to explain user-facing resultant changes
MadLittleMods ed9540a
Merge branch 'develop' into 8996-fix-sqlite-object-name-reserved-for-…
MadLittleMods File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix 'object name reserved for internal use' errors with recent versions of SQLite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,12 +162,23 @@ else | |
fi | ||
|
||
# Delete schema_version, applied_schema_deltas and applied_module_schemas tables | ||
# Also delete any shadow tables from fts4 | ||
# This needs to be done after synapse_port_db is run | ||
echo "Dropping unwanted db tables..." | ||
SQL=" | ||
DROP TABLE schema_version; | ||
DROP TABLE applied_schema_deltas; | ||
DROP TABLE applied_module_schemas; | ||
DROP TABLE event_search_content; | ||
DROP TABLE event_search_segments; | ||
DROP TABLE event_search_segdir; | ||
DROP TABLE event_search_docsize; | ||
DROP TABLE event_search_stat; | ||
DROP TABLE user_directory_search_content; | ||
DROP TABLE user_directory_search_segments; | ||
DROP TABLE user_directory_search_segdir; | ||
DROP TABLE user_directory_search_docsize; | ||
DROP TABLE user_directory_search_stat; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't tested these changes as the script seems to fail for me before it gets there. Also is there a way to run without a postgres username? (I had to comment that part of the shell script out)
|
||
" | ||
sqlite3 "$SQLITE_DB" <<< "$SQL" | ||
psql $POSTGRES_DB_NAME -U "$POSTGRES_USERNAME" -w <<< "$SQL" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, there is documentation about this script at
synapse/storage/databases/main/schema/full_schemas/README.md