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 with Redshift #142

Open
sachinpadya opened this issue Nov 26, 2024 · 0 comments
Open

Liquibase with Redshift #142

sachinpadya opened this issue Nov 26, 2024 · 0 comments

Comments

@sachinpadya
Copy link

sachinpadya commented Nov 26, 2024

I am getting below error when trying to run the liquibase update command using github actions.
Unexpected error running Liquibase: ERROR: current transaction is aborted, commands ignored until end of transaction block

  • Caused by: ERROR: syntax error at end of input
    Position: 20
    ====================================================
    This is my changelog.sql file

-- changeset DP:1
-- Purpose: Create the initial example_table with primary key and constraints
CREATE TABLE install.liquibase_table (
id INT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
description VARCHAR(255),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP
);

=======================================================

``My workflow:

name: Liquibase Update with Redshift
on:
workflow_dispatch:
inputs:
changelog_file:
description: 'Liquibase changelog file name'
required: true
default: 'changelog.sql'
changelog_file_path:
description: 'Path to the Liquibase changelog file'
required: true
default: 'redshift/stg/install'

jobs:
liquibase-update:
runs-on: lytx-data-runner
steps:
- name: Check out code
uses: actions/checkout@v3

  - name: Download Redshift JDBC driver
    run: |
      curl -L -o redshift-jdbc42-2.1.0.28.jar https://s3.amazonaws.com/redshift-downloads/drivers/jdbc/2.1.0.28/redshift-jdbc42-2.1.0.28.jar

  - name: Move JDBC driver to liquibase/lib directory
    run: |
      mkdir -p liquibase/lib
      mv redshift-jdbc42-2.1.0.28.jar liquibase/lib/
      
  - name: Liquibase operation
    uses: liquibase-github-actions/[email protected]
    with:
      changelogFile: "${{ github.event.inputs.changelog_file_path }}/${{ github.event.inputs.changelog_file }}"
      url: ${{ secrets.REDSHIFT_ENDPOINT }}
      driver: "com.amazon.redshift.jdbc42.Driver"
      password: ${{ secrets.REDSHIFT_PASSWORD }}
      username: ${{ secrets.REDSHIFT_USERNAME }}
      classpath: "./liquibase/lib/redshift-jdbc42-2.1.0.28.jar"
      options: "--logLevel=debug --autocommit=true"``
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

No branches or pull requests

1 participant