fix: Clean up migration scripts to be postgres/mysql compatible #476
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.
made sure upgrade/downgrade would work for both MySQL and Postgres
Updated all foreign key on delete behavior to either cascade or set null.
fixed some erroneous typing and code (such as notification.user is varchar instead of int, and some 0 or 1 type comparison for boolean)
NOTE: i did an implicit type conversion for acl_control to be JSON at the start (since Postgres dislikes type conversions from str to json), existing MySQL users would need to update acl_control to be in JSON manually, but even if they don't it should not impact usability of the app.
in future we probably need documentation on how to connect to a postgressql database (right now the key package psycopg2 is missing, while pymysql is installed by default)
another things to note is that maybe we should consider moving the default development database to sqlite?