Quantcast
Channel: Liquibase Forums
Viewing all 2993 articles
Browse latest View live

Code referencing com/amazon/redshift/core/jdbc42/PGJDBC42DriverImpl at runtime

$
0
0
Hello

I am using liquibase to connect to Redshift to manipulate my DDL. I am using the following Pom dependencies:

  1.     <dependency>
  2.         <groupId>com.amazon.redshift</groupId>
  3.         <artifactId>redshift-jdbc42</artifactId>
  4.         <version>1.2.8.1005</version>
  5.     </dependency>
  6.     <dependency>
  7.         <groupId>org.liquibase.ext</groupId>
  8.         <artifactId>liquibase-redshift</artifactId>
  9.         <version>1.0</version>
  10.     </dependency>
  11.     <dependency>
  12.         <groupId>org.liquibase</groupId>
  13.         <artifactId>liquibase-core</artifactId>
  14.     </dependency>

and in my properties file, I reference the following driver:

  1. datasource.config.driver-class-name=com.amazon.redshift.jdbc42.Driver
In my local environment, my code works fine, but when I deploy the code and during runtime, I receive the following error:

  1. [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/amazon/redshift/core/jdbc42/PGJDBC42DriverImpl

I am not sure what is calling this driver, but I verified that I am able to pick up the properties file in DEV, but it keeps calling a driver (PGJDBC42DriverImpl) that I am not specifying. I have explicitly called out the driver I want to use in my DEV properties file. (com.amazon.redshift.jdbc42.Driver) 

I have found a few other solutions out there, but I am unable to resolve my problem. For example:
  1.  using com.amazon.redshift.core.jdbc4.PGJDBC4DriverImpl, but I cannot find it in the jar RedshiftJDBC4-no-awssdk-1.2.8.1005.jar


That does not resolve my problem because now I get the known redshift "TAG" issue. I was able to resolve that with using com.amazon.redshift version 1.2.8.1005. By using the no awssdk jar, I revert myself to the insert into the changelog table issue. 

Any help will be greatly appreciated!

Use Liquibase, hsqldb and postgre

$
0
0
Hello,

I am new to liquibase and started to learn it. I set my postgre database and connected it to liquibase.
driver: org.postgresql.Driver
classpath: ./lib/postgresql-9.2-1002-jdbc4.jar
url: jdbc:postgresql://db-tools.localhost.squaretrade.com:5432/tools
username: ""
password: ""
changeLogFile: src/main/db/tools/public/changelog/main_tools_changelog.xml
and I also want to use HSQLDB for in memory database to run my tests.
I searched many of the topics here and also on internet but didn't get correct result.
Some are using only hsqldb with liquibase and some postgre.
I concern is, I want to dump my postgre database and add it to liquibase which I did, and then I want to use  hsqldb for in memory.
is it possible?

Thanks

Phoenix/Hbase Extension

Re : Logging Changes

$
0
0
Hi Sorry for corrupting logging thread but I think It has something to do with this change.
As with 3.6.0-SNAPSHOT I'm trying to run migration pulling changelogs from war file... something like this:

  1. java -jar liquibase.jar \
  2. --driver=oracle.jdbc.OracleDriver \
  3. --classpath=website.war \
  4. --changeLogFile=com/example/db.changelog.xml \
  5. --url=jdbc:oracle:thin:@localhost:1521:oracle \
  6. --username=scott \
  7. --password=tiger \
  8. update

but this won't work because of dependency on slf4j, logback-core and logback-classic. You will need to provide classpath for java execution...eg something like this:


  1. java  -cp ~/.m2/repository/org/liquibase/liquibase-core/3.6.0-SNAPSHOT/liquibase-core-3.6.0-SNAPSHOT.jar:~/.m2/repository/ch/qos/logback/logback-core/1.1.11/logback-core-1.1.11.jar:~/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar:/home/lvasek/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar \
  2.       liquibase.integration.commandline.Main \
  3.       --help


So maybe the documentation here http://www.liquibase.org/documentation/command_line.html should be changed with 3.6.0



Liquibase java 8 LocalTime, LocalDate, LocalDateTime support

$
0
0
Hi, 
I use liquibase on many project, but we need to used java 8 date/time object. When i use liquibase to create Diff with database and java all java 8 date type is create with BYTEA in liquibase migration. Can you add the correct mapping : 
- LocalDate -> Date
- LocalDateTime -> TIMESTAMP WITHOUT TIME ZONE
- LocalTime -> TIME WITHOUT TIME ZONE
Thank's 

Re : data Difference between two schemas in Liquibase

$
0
0
team, help/tips to acheive my above stmt will be much appreciable.

Re : Not loading SnakeYAML?

$
0
0
Hi, 

I am facing the same issue. I tried creating lib dir but still not working.

I am using liquibase 3.5.3.


HELP- can't run liquibase in command-line

$
0
0
I've created a liquibase.properties like this:
  1. classpath=./postgresql-42.1.4.jar:./snakeyaml-1.18.2.jar
  2. changeLogFile=./src/main/resources/db/changelog/db.changelog-master.yaml
  3. username=postgres
  4. password=mysecret
  5. url=jdbc:postgresql://localhost:5432/mydatabase 
  6. driver=org.postgresql.Driver

And try to perform a simple update:

  1. liquibase update
And I get the error:
  1. Unexpected error running Liquibase: org.yaml.snakeyaml.Yaml
As can be seen in the file i've added two files to the current folder I'm executing it:
- postgresql-42.1.4.jar
- snakeyaml-1.18.2.jar

and finally this is the yaml file for the updates:
  1. databaseChangeLog:
  2.     - includeAll:
  3.         path: db/changelog/changes/
NOTE: I've added this into a spring boot app and when the app runs this gets updated without any hassle.
SECOND NOTE: I've had to add the file postgresql-42.1.4.jar, because otherwise it kept giving me the error:
  1. Connection could not be created to postgresql://localhost:5432/mydatabase with driver org.postgresql.Driver.  Possibly the wrong driver for the given database URL
So, it's very frustrating, since this should be the simplest way to use liquibase.

Any help ? 





ChangelogDatabase table exists?

$
0
0
Hi Team,

I am exploring Liquibase for my learning for database automation deployment. I am stuck with an issue, can you please assist me on it.

1. I have manually created the changelogdatabase table and lock table, now when I ran the "mvn liquibase:update", it give me an exception mentioning the object is already exist. How can I handle this exception?

2. Also, We have other use case, where we create the changelogdatabase by defining its custom name in pom.xml. Now Whenever I uses command "mvn liquibase:update" its throwing me exception. When I uses "mvn liquibase:updateSQL" it say done successfully but nothing is update my database.


Can you please assist where are doing wrong. Thanks in Advance.

Re : ChangelogDatabase table exists?

$
0
0
Hi Sangwan,

  1. you do not need (and probably should not) create the liquibase tables on your own. Liquibase will do that for you on it's first run, where something needs to be logged. Anyways one common problem may be that liquibase does not see the tables because it has not the required access rights.
  2. For the second part of your question, the liquibase update command is actually interacting with the database and doing work, this is where things can fail. The updateSQL command on the other hand is just generating the sql liquibase would execute to your database, but it is actually not doing anything. updateSQL is intended for environments where other authorities have to double check the sql before executing it (e.g. by the DBA).
Hope that helps.

kind regards
Daniel

Re : ChangelogDatabase table exists?

$
0
0
Thank you Daniel for the response.

I have some following questions:

1. I have define custom name for change log table in POM.XML (assume in properties file case as well). It works successfully, but when I run the same from other match using same POM file, it throws exception. But thats not the case with default change log table name. 

2. As you mentioned, "you do not need (and probably should not) create the liquibase tables on your own. " 
I have created table by my own, and when I ran the liquibase, it throws object exist exception. Can you please define how can I achieve the case. We are using Liquibase-3.5 version.


Re : ChangelogDatabase table exists?

$
0
0
Hi Sangwan,

was mentioned in my first answer, without a copy of the error you get, maybe more information about the database system you actually use and a copy of your configuration there's not much help anyone can give you.

A pretty common problem is that the tables you already created, are restricted to be seen by another user than liquibase uses to connect to the database. 
So try to connect to the database with the same user as liquibase does and select from the databasechangelog table works.
Double check that the structure you created is identical to what liquibase would create in a fresh instance.
Also make sure the user liquibase uses has the rights to create alter and maybe drop database structures.

kind regards
Daniel

Spool command in DDL is not working

$
0
0
spool C:\Users\ddl.log
create table Temp
(
A Number
);
/
spool off

Above is my file ,
when i try to run this file via liquibase, it provides the below error
Migration failed to changeset, invalid stamtement for the (ORA00900)

Can any one help whow to include spool command in script?

Re : Liquibase vs SQLPLUS for SPOOL output.

$
0
0
Are you able to solve this problem? If then, please share me the steps

Re : Liquibase vs SQLPLUS for SPOOL output.

$
0
0
When using Liquibase keep in mind, that it is executing all sql commands directly via JDBC. So all non JDBC conform command will throw a error.

I know many DBMS have command line tools with special command sets (sqlplus or db2 cli are examples) but their extensions are not valid sql and can not be executed by liquibase. You either have to rewrite the sql files or change them in some kind of preprocessing (search and replace the suspect lines).

Java 9 Support

$
0
0
Currently liquibase fails to work on java 9 due to incorrect parsing of the version number, there is are some pull request to try to fix this https://github.com/liquibase/liquibase/pull/710

We have patched locally and works well. Is it possible to get a release with this in?

Error in url: jdbc:postgresql://localhost:5432 liquibase

$
0
0
I am new to liquibase and unable to follow the docs and expected behaviour .
I want to setup the liquibase for local database named liquibase. 
Here i dont know hich commands are to be executed first and which next.
Guide me with this and error what is being displayed

Re : Spool command in DDL is not working

how can I run a set of changeSet in transaction

$
0
0
Hi

I need to run a set of changeSet in transaction, how can I do it ?
Or maybe a way to "--changeLogFile update" in transaction.

I know that each changeSet has a transaction, but I need only one transaction for all.

Thanks

Future of Liquibase?

$
0
0
Hello Nathan,

First of all, thank you so much for all the hard work you've done on Liquibase over the years! I've been using it for about 6 years now, and it's enabled a lot productivity gains on many different projects I've used it on. 

I was hoping that perhaps you could give us an update on your realistic future plans for Liquibase. 

It's been over a year since the last release and progress seems to have fully halted on new public development as well as bug fixes and PR approval / merges. I know there was a bit of activity when DBManul was announced and some changes were merged back in, but it's since stopped again. PRs for rather important things like Java 9 support are sitting unreviewed. I notice that there is a significant amount of work happening in the Datical Liquibase fork, but while that is ostensibly open source (i can certainly see the code) - there is no indication of what those changes are or if there is ever an expectation of public binaries to be released from it. Is the intention there something that you are at liberty to clarify?

If I look back over the last 7 years of history on Liquibase - I can see that tickets were closed fairly consistently up until 2016, when it looks like progress came to a halt. 

I promise, I'm not trying to pass any judgement here. You created this project and if even if it never receives another update you've given a lot to the community! What I am trying to do though, is understand what I should plan for when starting new projects. Is it realistic to expect to continue to be able to use Liquibase or should I invest my time learning an alternative more actively maintained project e.g. Flyway. (Though I admittedly much prefer Liquibase's model). 

Again, thank you so much for all the work you've put in over the years, it's much appreciated by me and many others!

-Ben
Viewing all 2993 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>