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

Re : Liquibase spring bean "log" property

$
0
0
I am not sure about the log property. I don't see it on the SpringLiquibase class or the Liquibase class. I can give you a bit of info on how to get logging routing to Log4J.

Liquibase 3.x has its own logging implementation that uses no external logging dependencies. The default logger logs to standard out (which is what I suspect you are seeing now). In order to route Liquibase logs to another logging framework you need to place an adapter jar on your classpath. I did some searching and found a couple of links about the log4j logging adapter:

Maven Central - Log4j Liquibase
Liqubase Wiki on Logging extensions

If you are using SLF4J as a logging facade there is also an extension to route Liquibase logs to that (Full Disclosure: I wrote that library).

Github - liquibase-slf4j

Once the adapter jar is on your classpath, the configuration you have defined above should start to function as you expect.

I hope this helps.

More database objects support

$
0
0
Hi,
I've found that the enterprise solution (datical) does support almost all of the database objects (domains, enums, triggers, ...), but because it is enterprise solution, I'm affraid that prices will be in thousdands or ten of thousands.

I would welcome some more advanced liquibase (optionally paid) version where only all database objects are supported from the enterprise version and nothing else. Would something like this be possible in the future? Or could we somehow sponsor addition of other database objects in OSS liquibase version?

Thank You

Liquibase Dryrun

$
0
0
Hello Users/Developers,

How do you do dry-run Liquibase to make sure that all the tags are valid before check-in your code to GIT?

Thanks,
Mahendra

Re : Liquibase Dryrun

$
0
0
Many developers will do a "dry run" by deploying to a local dev database. Most DB engines have a free developer version that can be used for this sort of testing. The other option is to use the option to just generate SQL rather than actually running the SQL. 

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

Re : changelog filename in database contains full OS path?

$
0
0
I know this is an old thread however, I am having the same issue using the Gradle plugin.  It seems to behave differently depending on if I run the script from the parent project or within the sub-project.  If I run it inside the subproject, it uses an absolute path.  If I run from the parent project, it uses the shorter path (like "src/db/main/changelogs/changelogxyz.sql").

This seems to cause a ton of grief for people including myself.  I wished it was as simple as absolutePath="true"/"false"

Re : changelog filename in database contains full OS path?

select @i := 0; UPDATE MYTABLE SET ID = (select @i := @i - 1);

$
0
0
Is it possible to run the following on MySQL using liquibase:

select @i := 0; UPDATE MYTABLE SET ID = (select @i := @i - 1);

I can run it ok from the netbeans SQL editor and from MySQL workbench using the sql file generated via updateSQL but I can't run it directly using liquibase:update with an error: Check MySQL manual near UPDATE MYTABLE SET ID = (select @i := @i - 1);

I've tried splitStatements="false" and endDelimiter=""

Script running order doesn't follow name sorting

$
0
0
Hello!

I'm using liquibase formatted sql, in master.xml i call a directory with include all. The running order of script doesnt follow alphabetical order. I have attached en example, in the attached example 10_sql.sql runs before 1_sql.sql.

Thanks in advance!

Regards
Raste

Re : Script running order doesn't follow name sorting

$
0
0
10 does come before 1 when sorted in "ASCII-betical" order. It would be better to name your files like this:

0001-firstfile.sql
0002-secondfile.sql

etc.

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

Re : Script running order doesn't follow name sorting

$
0
0
Thanks for fast responce!

well i solved the problem in that way my self, that would definetly work. But technically when you come up to fifth digit then all files renamed with a leading zero which is not so effective when it comes to Git version controled script.

is there anyway to choose another sorting mechanism in coming liquibase versions?

Regards
Raste

Re : Script running order doesn't follow name sorting

$
0
0
As far as I know, there is no other way to set the sorting order. If you are concerned about eventually having more than 9,999 change files, start with a 5 digit number so you won't have to deal with it until 99,999. Should be enough for any project I have ever run across. 

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

Liquibase: can it automatically figure out that a rollback is needed instead of an update?

$
0
0
Is there a way to make Liquibase figure out whether to run an "update" versus a "rollback"?

When we deploy a set of code in an environment, we want the related DB changes (using Liquibase update) to be applied in lockstep. We may sometimes need to roll back the code deployed, which simply involves deploying an older set of code (the older code overwrites the newer code). However in the case of Liquibase, running an update with an earlier changeset will not do anything since there is nothing new to be applied.  However, the DB still has changes related to the newer Liquibase changeset which might pose a problem (eg if the structure of a table was changed). In this case, we may specifically require to run a "rollback" instead of an "update" which requires human intervention.

Am I missing an option in Liquibase that would make my life easier?

Re : Liquibase: can it automatically figure out that a rollback is needed instead of an update?

$
0
0
I don't think you are missing anything.

One thing you might take a look at is the liquibase status command. The documentation says it will give you a count of unrun changesets, or a list of unrun changesets with the --verbose option. I don't know if it will list "extra" changesets (this would be changesets that are marked as applied in the DATABASECHANGELOG table, but that do not exist in the changelog.xml). If it does show the 'extra' changesets, you could use that as an indication that rollback might be necessary. 

In that case, you would need to have a workflow where the changelog is packaged with the application, so that when you shipped version 2.0 of the app, it had version 2.0 of the changelog, and version 2.1 of the app had version 2.1 of the changelog. If you roll back the app from 2.1 to 2.0 by just re-installing app 2.0, you might be able to tell using the status command that a rollback of the database was necessary (the db changes for 2.1 would be in the DATABASECHANGELOG table, but not mentioned in the 2.0 changelog) but you would still need the 2.1 changelog (with any custom rollback tags required for the 2.1 'go forward changes') in order to safely roll back the database from 2.1 to 2.0.

Hope this helps,

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

Re : Liquibase: can it automatically figure out that a rollback is needed instead of an update?

Re : Liquibase: can it automatically figure out that a rollback is needed instead of an update?


Java Version Requirements for Liquibase Version 3.4.2

$
0
0
We recently upgraded to Liquibase version 3.4.2 and are unable to run with Java version 1.6. The Liquibase website still says 3.x requires Java 1.6+:


Is this accurate?

Re : Java Version Requirements for Liquibase Version 3.4.2

Re : Java Version Requirements for Liquibase Version 3.4.2

$
0
0
We receive this error message:

com/microsoft/sqlserver/jdbc/SQLServerDriver : Unsupported major.minor version 52.0

Re : Java Version Requirements for Liquibase Version 3.4.2

$
0
0
It actually looks like it is your SqlServer JDBC driver that requires java 8. 

Nathan

Best practices regarding testing liquibase changes in CI?

$
0
0
I am trying to find out what are the best ways to test liquibase changes in CI. 

Here is some info on our CI environment:
-All CI builds are running against 1 schema  (We would like to move 1 build per schema)
-Multiple builds could be running concurrently


My goal is to only test the new scripts that are checked in.  It should be noop if no liquibase changes were checked in.

What I thought originally was executing the following with no prompt flag:
mvn liquibase:tag -Dliquibase.tag=$TIMESTAMP
mvn liquibase:update
mvn liquibase:rollback -Dliquibase.rollbackTag=$TIMESTAMP
mvn liquibase:update
mvn test
...

However, I am concerned that if multiple builds are running on the same schema, the TIMESTAMP from two builds would step on each other.   Anyway I could work around that before schema becomes non-shared.

Note that I think I need to use $TIMESTAMP because static tag could cause extra work to be done by liquibase.

For example,  if my DATABASECHANGELOG looks like the following,

ID  TAG
5    TEST
4    
3    
2    TEST  

mvn liquibase:rollback -Dliquibase.rollbackTag=TEST would rollback 4 and 3, and what I want is to rollback nothing.  In addition, there is no option to remove tag, so the situation seems inevitable.




Viewing all 1169 articles
Browse latest View live


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