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

Re : Support for Hive (Hadoop) schema changes via Liquibase?

$
0
0
I don't know enough about Hive/Hadoop to provide a definitive answer, but in general Liquibase is extensible to new database types. In version 3.x there is still some database-specific code in Liquibase core, but I know that Nathan (the guy who wrote Liquibase and still the project owner) is planning to remove that in the 4.0 version, which is currently in the early stages. 

There are some docs on writing your own extensions, as well as information on the extensions currently available at https://liquibase.jira.com/wiki/display/CONTRIB/LiquiBase+Extensions+Portal

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : A single user for all schemas?

$
0
0
We have slightly different setup; we don't use Oracle or settings.xml, but we do have a similar issue with superuser access and multiple schemas and maven.

For us our username/passwords are setup in a maven pom.xml which contains <properties><db.user>liquibasedeploy</db.user></properties> section and then a  
                  <plugin>
                        <groupId>org.liquibase</groupId>
                        ...
                        <configuration>
                            ... <username>${db.user}</username>
sort of section which refers to the variables setup in the propeties section.

In this way, we can modify the user and/or password credentials used in our different environments by overriding the maven properties within Jenkins or from the command line with a  "-Ddb.user=NEWVALUE" sort of approach, and this can be done by deployment teams without modfiying or touching the code in our .xml files.

In the same way you can override the username, you can override the JDBC <url> which specifies the schema your changes are being made in without having to specify them all in your maven .xml.

  --Greg

Drop All Database Objects fail in liquibase

$
0
0
when i am trying to **drop all objects from a database using Liquibase**, its getting error. After running in debug mode i found that its trying to drop sequence after dropping table. So get a error ' sequence not exists'.
I am running in a schema named "1", But in public schema it build successfully(not trying to drop sequences).

Here is my ANT target:

    <target name="dropAll" depends="prepare" >
        <dropAllDatabaseObjects
                driver="${db.driver}"
                url="${db.url}"
                username="${db.username}"
                password="${db.password}"
                defaultSchemaName="${db.schema}"
                promptOnNonLocalDatabase="yes"
                classpathref="classpath"
                />       
    </target>

Here is the log error:

    [dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."database_change_log" CASCADE
    [dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."database_change_log_lock" CASCADE
    [dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."party" CASCADE
    [dropAllDatabaseObjects] Executing EXECUTE database command: DROP SEQUENCE "1"."party_id_seq" CASCADE
    [dropAllDatabaseObjects] Release Database Lock
    [dropAllDatabaseObjects] Executing UPDATE database command: UPDATE "1".databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID =1
    [dropAllDatabaseObjects] Successfully released change log lock

    BUILD FAILED
    D:\Liquibase 3.3.2-ems\common-model\build.xml:90: Unable to drop all objects from database.
        at   liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader(DropAllTask.java:31)
        at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:82)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:392)
        at org.apache.tools.ant.Target.performTasks(Target.java:413)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Caused by: liquibase.exception.DatabaseException:   org.postgresql.util.PSQLException: ERROR: sequence "party_id_seq" does not exist
        at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112)
        at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:753)
        at liquibase.Liquibase.dropAll(Liquibase.java:743)
        at liquibase.Liquibase.dropAll(Liquibase.java:730)
        at liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader(DropAllTask.java:28)
        ... 17 more
       Caused by: org.postgresql.util.PSQLException: ERROR: sequence "party_id_seq"does not exist
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397)
        at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314)
        ... 24 more

Re : Understanding validCheckSum

Did I create Jira / pull request correctly?

$
0
0

Hi, all.

I've followed the guidelines on the Liquibase DEV page as best I can.  Can someone cross check that I've done things right?  Here's what I did:

1) Registered as a user with Atlassian Cloud so I could create a Jira issue.

2) Created Jira issue CORE-2262

3) Forked the Liquibase repo at https://github.com/liquibase/liquibase, creating https://github.com/bsandiford/liquibase

4) Set my new repo default branch to 3.3.x to match where I'd like the fix made in Liquibase.

5) Checked out from my new repo, fixed the problem, committed and pushed back to my repo.  Commit message includes the Jira number, summary, and what I fixed.

6) Created a pull request, and put a comment on the Jira issue so that it references the pull request (#366)

7) Waiting for someone to look at the pull request / merge back (hopefully!) / update the Jira.


One additional question.  I have another bug fix I'd like to make.  Do I need to clone Liquibase again, or can I just continue in my own repository?

Thanks!

Bob (newbie) Sandiford.

Re : Did I create Jira / pull request correctly?

$
0
0
Looks like you did everything correctly to me. I know Nathan is pretty busy, so it might be a few days before this gets merged, etc. 

You will not need to clone again to do more work. You will need to make sure you are up-to-date before you push changes, so you will need to `git pull`.

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : Did I create Jira / pull request correctly?

Re : Did I create Jira / pull request correctly?

$
0
0

OK - turns out I missed a step.  For multiple pull requests from the same fork, each change should be checked into a separate branch of the forked code.  Otherwise, subsequent checkins to the base of the fork just end up being added to the first pull request.

So, I'm branching my repo for each separate change, and I'll do a pull request for each branch - that will keep them all separate.


Generate SQL from ChangeLog using API and being Offline

$
0
0
Hello,

I am trying to merely convert ChangeLog into an SQL file using the Java API. I tried something like:
  1. Database database = DatabaseFactory.getInstance()
  2.   .findCorrectDatabaseImplementation(new OfflineConnection("offline:oracle"));
  3. Liquibase liquibase = new Liquibase("changeLog.xml", resourceAccessor, database);
  4. liquibase.update(new Contexts(), writer);

But I get on the very first line:

  1. liquibase.exception.UnexpectedLiquibaseException: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()
  2.     at liquibase.database.core.OracleDatabase.setConnection(OracleDatabase.java:62)
  3.     at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:123)

What I did miss? Where could I find an example of code to do that?

Thanks for your help,

Gérald

UpdateSQL ignores dbms type?

$
0
0
We have a setup where we sometimes need our database in MSSQL, and other times in HSQL.  We'd like to have one file that could run against either DB and react accordingly to the nuances of either.  We have attempted to solve the problem by using preconditions to check for the database type, and when liquibase runs update against a database it works fine, but when we use updateSQL it prints the SQL queries for both changesets, causing an error when the resulting script is run later.  Is this a bug or is there a different way to tell liquibase the type of database it is dealing with when using updateSQL?

Thanks,

Re : Generate SQL from ChangeLog using API and being Offline

$
0
0
Same problem with  Liquibase command line
  1. liquibase --changeLogFile /path/to/changeLog.xml --url offline:oracle  updateSQL
  2. Unexpected error running Liquibase: java.lang.NoSuchMethodException: liquibase.database.OfflineConnection.getWrappedConnection()

Is it a bug or do I misuse Liquibase?

Re : Generate SQL from ChangeLog using API and being Offline

$
0
0
I guess it's bug in OracleDatabase#setConnection because using MySQL instead of Oracle, I have no problem.

Re : YAML update fails with Unexpected error running Liquibase: java.util.LinkedHashMap cannot be cast to java.util.List

Re : FILENAME column in databasechangelog table.

$
0
0
Sorry for the slow response. Have you tried it with Liquibase 3.3.2? When I try replicating your setup, it is checking files with the relative path. It may have been something fixed in 3.3.

If you run "select * from databasechangelog" you should see the path value containing what is stored. If you run liquibase updateSql it will output the path it will try to insert into the databasechangelog table. How do they differ?

Nathan 

Re : Using Liquibase 3.3.2 with Vertica 7.1 : java.lang.NoSuchMethodError: liquibase.snapshot.JdbcDatabaseSnapshot$CachingDatabaseMetaData.getTables


Re : How to create a "super"-table which will be always created infront of any table?

$
0
0
This seems like a fairly safe addition, so it seems likely that it could be included into the project mainline. If you include unit tests for the change and ensure that no existing tests break, the chances of it being included are even better. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : UpdateSQL ignores dbms type?

$
0
0
It should be respecting the dbms attribute in updateSQL. What version of liquibase are you running?

Nathan

Re : Drop All Database Objects fail in liquibase

Re : Support for Hive (Hadoop) schema changes via Liquibase?

$
0
0
Yes, support for Hive changes are definitely possible. The existing 3.x extension system should allow you to plug something in but like Steve says I am busily working on larger changes with 4.x that will make it easier to support new environments.

Nathan

Re : Liquibase gives different results from Ant and the command line

$
0
0
I added a comment to the stackoverflow post. Sorry for the slow response.
Viewing all 2993 articles
Browse latest View live


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