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

__yuniql_schema_version schema mismatch #299

Open
eduardo-aguilar opened this issue May 22, 2023 · 1 comment
Open

__yuniql_schema_version schema mismatch #299

eduardo-aguilar opened this issue May 22, 2023 · 1 comment

Comments

@eduardo-aguilar
Copy link

eduardo-aguilar commented May 22, 2023

We're using YuniQL as our schema versioning and database migration engine for a Postgres DB. The issue we're seeing is the following:

  • We ran YuniQL initially with version v1.1.55.0
    • Yuniql creates the __yuniql_schema_version table with the schema for that version.
  • We run more scripts with a different version of YuniQL (v1.3.15.0).

Expected Behavior

YuniQL recognizes that new version of YuniQL has a different schema for the __yuniql_schema_version table and updates it.

Actual behavior

We continue having the same schema for the __yuniql_schema_version.

Is there a YuniQL way of solving this issue?

We continue having:

CREATE TABLE 
    __yuniql_schema_version 
    ( 
        sequence_id SMALLSERIAL NOT NULL, 
        VERSION        CHARACTER VARYING(512) NOT NULL, 
        applied_on_utc TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT timezone('UTC'::TEXT, 
        CURRENT_TIMESTAMP) NOT NULL, 
        applied_by_user         CHARACTER VARYING(32) DEFAULT USER NOT NULL, 
        applied_by_tool         CHARACTER VARYING(32) NOT NULL, 
        applied_by_tool_version CHARACTER VARYING(16) NOT NULL, 
        status                  CHARACTER VARYING(32) NOT NULL, 
        duration_ms             INTEGER NOT NULL, 
        checksum                CHARACTER VARYING(64) NOT NULL, 
        failed_script_path      CHARACTER VARYING(4000), 
        failed_script_error     CHARACTER VARYING(4000), 
        additional_artifacts    CHARACTER VARYING(4000) 
    );

We want to have:

CREATE TABLE 
    __yuniql_schema_version 
    ( 
        sequence_id SMALLSERIAL NOT NULL, 
        VERSION        CHARACTER VARYING(512) NOT NULL, 
        applied_on_utc TIMESTAMP(6) WITHOUT TIME ZONE DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'UTC' 
        ::TEXT) NOT NULL, 
        applied_by_user         CHARACTER VARYING(128) DEFAULT USER NOT NULL, 
        applied_by_tool         CHARACTER VARYING(32) NOT NULL, 
        applied_by_tool_version CHARACTER VARYING(16) NOT NULL, 
        status                  CHARACTER VARYING(32) NOT NULL, 
        duration_ms             INTEGER NOT NULL, 
        checksum                CHARACTER VARYING(64) NOT NULL, 
        failed_script_path      CHARACTER VARYING(4000), 
        failed_script_error     CHARACTER VARYING(4000), 
        additional_artifacts    CHARACTER VARYING(4000) 
    );
@rdagumampan
Copy link
Owner

@eduardo-aguilar thanks for reaching out and please excuse for long delay. Im not sure I complete follow the issue here. Those two versions of yuniql should have the same schema structure of the tracking table __yunisql_schema_version. This structure stands to last and I dont see any other changes to it in foreseable future.

Actually, the only time yuniql upgrades the schema of tracking table was when I dropped __yuniqldbversion and change into __yuniql_schema_version. HTH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants