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.
This PR reworks a lot of the database functionality and interface to make it more modular and more consistent, and to reduce code duplication.
It also updates a lot of the Postgres implementation of the DB interface to make better use of the ORM being used, and to implement caching of results for quicker serving of things like accounts, statuses etc. Using an in-memory cache reduces network usage, CPU usage (when ssl is enabled on postgres), and improves speed of object retrieval--when cached--by several orders of magnitude.
These changes will certainly impact on #122, since they change the database interface around a bunch. In the long run however the changes should make SQLite implementation a bit easier overall, since it can be implemented sub-interface by sub-interface.
Migration considerations
What to look out for when updating to this version from previous gts prerelease versions.
Non-breaking changes
In order to make all of the updates work, two new database tables were introduced:
status_to_tag
andstatus_to_emoji
.These will be automatically created when GtS is restarted with this new update, so no need to worry about them.
Breaking Changes!!!!
Due to an inconsistency in the way the
tags
table was previously implemented (now fixed), some manual postgres jiggery-pokery is required when updating.To migrate to this version from a previous version, first stop gotosocial, then run the following PSQL queries against your gotosocial postgres database:
Then start the new version of gotosocial :)