Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #5605 alembic migration errors on Focal #5608

Merged
merged 1 commit into from
Nov 3, 2020

Conversation

kushaldas
Copy link
Contributor

Status

Ready for review

Description of Changes

Fixes #5605

Due to SQLite3 upgrade in Focal, our previous migration scripts
were failing.

From SQLite website https://sqlite.org/lang_altertable.html:

enhanced in versions 3.25.0 (2018-09-15) and 3.26.0 (2018-12-01) in order to
carry the rename operation forward into triggers and views that reference the
renamed table. This is considered an improvement. Applications that depend on
the older (and arguably buggy) behavior can use the PRAGMA legacy_alter_table=ON
statement or the SQLITE_DBCONFIG_LEGACY_ALTER_TABLE configuration parameter on
sqlite3_db_config() interface to make ALTER TABLE RENAME behave as it did prior
to version 3.25.0.

As @rmol suggestied, this PR is only using the PRAGMA calls where we are doing rename_table operations.

Testing

  • make test should pass all tests
  • make test-focal (after rebasing) on the dev_focal branch should not have any Alembic test failures
  • CI should be green

Deployment

Any special considerations for deployment? Consider both:

  1. Upgrading existing production instances.
  2. New installs.

Checklist

If you made changes to the server application code:

  • Linting (make lint) and tests (make test) pass in the development container

If you made changes to securedrop-admin:

  • Linting and tests (make -C admin test) pass in the admin development container

If you made changes to the system configuration:

If you made non-trivial code changes:

  • I have written a test plan and validated it for this PR

Choose one of the following:

  • I have opened a PR in the docs repo for these changes, or will do so later
  • I would appreciate help with the documentation
  • These changes do not require documentation

If you added or updated a code dependency:

Choose one of the following:

  • I have performed a diff review and pasted the contents to the packaging wiki
  • I would like someone else to do the diff review

Due to SQLite3 upgrade in Focal, our previous migration scripts
were failing.

From SQLite website https://sqlite.org/lang_altertable.html:

``` Compatibility Note: The behavior of ALTER TABLE when renaming a table was
enhanced in versions 3.25.0 (2018-09-15) and 3.26.0 (2018-12-01) in order to
carry the rename operation forward into triggers and views that reference the
renamed table. This is considered an improvement. Applications that depend on
the older (and arguably buggy) behavior can use the PRAGMA legacy_alter_table=ON
statement or the SQLITE_DBCONFIG_LEGACY_ALTER_TABLE configuration parameter on
sqlite3_db_config() interface to make ALTER TABLE RENAME behave as it did prior
to version 3.25.0.
```
Copy link
Contributor

@rmol rmol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, of course.

@rmol rmol merged commit 6406ce4 into develop Nov 3, 2020
@rmol rmol deleted the alembic_migration_fix_due_to_sqlite_upgrade branch November 3, 2020 22:16
@eloquence eloquence added this to the 1.7.0 milestone Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alembic related failures on Focal
3 participants