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

Liquibase-vertica unable always tries to create DATABASECHANGELOG even after it has already created it. #115

Open
CathalDaly opened this issue Sep 8, 2022 · 2 comments
Assignees

Comments

@CathalDaly
Copy link

Liquibase Version: 4.15
Liquibase Integration & Version: CLI
Liquibase Extension(s) & Version: liquibase-vertica-4.15.0.jar
Database Vendor & Version: Vertica 11
Operating System Type & Version: WSL ubuntu

Description

After following the installation steps here https://docs.liquibase.com/install/tutorials/vertica.html and running the sql example provided the tables were created as expected, however any future command ie creating a tag or adding in another changeset causes the command to error
Unexpected error running Liquibase: [Vertica][VJDBC](4213) ROLLBACK: Object "DATABASECHANGELOG" already exists

Steps To Reproduce

  1. follow the https://docs.liquibase.com/install/tutorials/vertica.html and use the sql example it provides
  2. this will run successfully
  3. add in a new clause to the changeset eg
--changeset other.dev:2 labels:Deploy 2 context:adding col tag:version1
--comment: this is a test
alter table test_table add column country varchar(2)
--rollback ALTER test_table person DROP COLUMN country;
  1. the output from liquibase --changelog-file=example-changelog.sql update-sql shows that it will attempt to create the DATABASECHANGELOG table again, however it does not need to do so for DATABASECHANGELOCKLOG
    5)liquibase --changelog-file=example-changelog.sql update will cause
    Unexpected error running Liquibase: [Vertica][VJDBC](4213) ROLLBACK: Object "DATABASECHANGELOG" already exists

example-changelog.sql NOTE: the seconds changeset was added in after the first successful run

--liquibase formatted sql

--changeset Cathal.Daly:1 labels:example Deploy context:create table tag:version1
--comment: this is a test
CREATE TABLE test_table
(
    test_id INT,
    test_column VARCHAR(256),
    PRIMARY KEY (test_id)
)
--rollback DROP TABLE test_table;

--changeset other.dev:2 labels:Deploy 2 context:adding col tag:version1
--comment: this is a test
alter table test_table add column country varchar(2)
--rollback ALTER test_table person DROP COLUMN country;

propertyfile

changeLogFile=example-changelog.sql
liquibase.command.url= mydb
liquibase.command.username: my_user
liquibase.command.password: my_password
liquibase.hub.mode=off

commands used

liquibase  --changelog-file=example-changelog.sql update-sql
liquibase  --changelog-file=example-changelog.sql update

Actual Behavior

The test_Table was created along with the DATABASE* tables, then I added in the changeset to add a column to the table and upon rerunning the above commands liquibase failed stating that, the DATABASECHANGELOG table specifically, already existed.

Expected/Desired Behavior

The second update should complete and be added to the existing test_table along with the tracking entry in DATABASECHANGELOG

Screenshots (if appropriate)

first run
image

second run
image

@skduma
Copy link

skduma commented Oct 5, 2022

@CathalDaly I have very same issue when using the liquibase maven plugin with vertica.

I did some debugging and It seems that property liquibaseSchemaName ( see creating-config-properties ) must be set explicitly, otherwise existing internal processing of object comparison in liquibase-core fails which leads to liquibase changelog table "not found".

@nvoxland
Copy link

nvoxland commented Oct 7, 2022

The liquibaseSchemaName setting should not be required to be set. It should default to the defaultSchemaName which should come from the database.

Is there something in the VerticaDatabase class that is getting in the way of that normal behavior? If you can find where it's causing problems you can send along a pull request.

@nvoxland nvoxland moved this from Candidate to Open Issues in Liquibase Open Source Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Open Issues
Development

No branches or pull requests

4 participants