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

Recalculate checksums #2

Merged
merged 4 commits into from
Feb 9, 2024
Merged

Recalculate checksums #2

merged 4 commits into from
Feb 9, 2024

Commits on Feb 27, 2023

  1. Add undo script functionality

    Taking inspiration from Flyway, this commits adds the undo subcommand to
    the application, with the `--step <n>` flag.
    
    Undo scripts will have the `U` prefix, with the same name and version as
    their corresponding versioned script. It will attempt to undo <n> amount
    of versioned scripts until it finishes, or no corresponding undo script
    is found.
    
    Under the hood, the application is removing the `V` script from the
    change history table, so when the `deploy` command is ran, the versioned
    script can be applied again.
    
    Algorithm:
    
    * Fetch all applied `V` migrations
    * Fetch all `U` migrations
    * Get `U` migration of last `V` migration.
    * IF `V` migration has no `U` migration, process stops
    * Apply `U` script
    * Delete `V` script from the change_history_table related to `U`
    
    This commit closes issue Snowflake-Labs#19
    eaguilera23 committed Feb 27, 2023
    Configuration menu
    Copy the full SHA
    671d389 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2024

  1. Update requirements to allow OpenSSL 3.0 usage

    [Swithing to Debian 12](salemove/base-images#46) in python base image
    caused [OpenSSL switch](salemove/base-images#46 (comment)) from 1.1.1 to 3.0.
    
    Current version of `snowflake-connector-python` 2.8.0 which depends on
    `pyopenssl` 22.1.0 fails because of OpenSSL switch https://ci.at.samo.io/job/salemove/job/snowflake-ingestion/job/PR-589/8/consoleFull
    
    After the update of `snowflake-connector-python` to 3.7.0 `pyopenssl`
    becomes `23.3.0` and doesn't fail anymore in this image.
    
    Tested `snowflake-ingestion` in [this PR](salemove/snowflake-ingestion#600).
    [Pipeline](https://ci.at.samo.io/job/salemove/job/snowflake-ingestion/job/PR-600/6/consoleFull)
    doesn't fail anymore, and does migration/rollback successfully.
    
    CBRO-1908
    BondarenkoStas committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    2a4b621 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    94deeb5 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Add recalculate_checksum command

    In case you clone a database, you would want to recaclulate checksums for
    repeatable scripts as they already exist but checksum is wrong as database name
    has changed.
    
    Both deploy_command and recalculate_checksum use very similar body. Only
    differences are:
    
    1) Deploy deals with V, R, A migrations, while recalculation deals only with
    R migrations.
    2) Deploy also applies the script, while recalculation on updates
    schemachangetables.
    riiwo committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    5fd538d View commit details
    Browse the repository at this point in the history