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

Compability issues between master of liquibase-core and liquibase-hibernate

$
0
0
I have made developments in liquibase-core and liquibase-hibernate. So in my local pom.xml files I reference a local Nexus and also let liquibase-hibernate depend on the 3.3.0-SNAPSHOT version of liquibase-core since I need fixes I have made in liquibase-core.

But after pulling updates from upstreams to both liquibase-core and liquibase-hibernate liquibase-hibernate stopped working since master of liquibase-hibernate is compatible with version 3.2.0 of liquibase-core.

I had already made one pull request that was merged for liquibase-hibernate depending on a newly merged pull request for liquibase-core. I suspect this change has broken things for those using master of liquibase-hibernate. I was in the process of making another pull request, but as it stands it seems like I would need to wait until the release of version 3.3.0 of liquibase-core.

I don't really know how this should be handled...


Some Liquibase-related componentry for your perusal

$
0
0
I threw together three little components that might help out Liquibase developers.

The first component is a general Maven utility class called Artifacts that currently has one method in it.  The method takes in a bunch of stuff but basically sorts a Maven project's transitive set of dependencies from most autonomous to least.  You can see that here: https://github.com/ljnelson/maven-artifacts

Next up is a general-purpose Maven plugin called the artifact-maven-plugin.  Basically, it uses the class I just described to sort all the transitive dependencies of a project, then makes sure they're resolved, and then hands the sorted list off to a user-supplied processor to do...well, whatever it wants.  You can see that here: https://github.com/ljnelson/artifact-maven-plugin

Last is a processor that creates a Liquibase changelog whose contents consist of <include> statements.  The <include> statements are jar: URLs referencing the local Maven repository copies of a project's resolved artifacts.  You can see that here: https://github.com/ljnelson/maven-liquibase

When you put them all together properly, it means you can have jar files representing small chunky bits of an overall database schema that each contain only the Liquibase changelog fragments they need to describe only their tiny slice of the overall database world.  Then your Maven projects can then automatically stitch them together at unit or integration test time (using all these utilities) so that, for example, things like foreign key references across schema chunks continue to work.  Change your Maven dependencies?  Change the appropriate number of tables created, maintained, etc.

I'll have more to say on this in a blog post at http://lairdnelson.wordpress.com in the near future.  I wanted to post this here because I've been a happy user of Liquibase for a long time and wanted to give something back.

Best,
Laird

Re : Liquibase liquibase-maven-plugin does not run Integration Tests in Apache Maven

$
0
0
Since the Liquibase plugin is creating the tables, it sounds like you got the Liquibase part working. Not sure I can help you with your general project issues.

It doesn't sound like a Hibernate issue to me. I have a hunch it is your HSQLDB settings. I bet the failsafe plugin forks the process and the HSQLDB in-memory database is shutting down as it is only available to the creating JVM process. I would try not forking the failsafe plugin if you can or switching to file or server mode on the HSQLDB database so the data is persisted between processes.

That being said, this is probably not the best place for general Java project setup questions.

Re : Some Liquibase-related componentry for your perusal

$
0
0
That is a good way to manage your changelog. Thanks for posting them and pointing them out. Let us know when you have your blog post added.

Nathan

Re : Compability issues between master of liquibase-core and liquibase-hibernate

$
0
0
I'm working on improving the process, but I did just recently update liquibase-hibernate to reference 3.3.0-SNAPSHOT since there was the breaking API change. I try to keep those to a minimum but when I do run into a case I will update the extensions to work off master as soon as I can. 

Nathan

Re : Allow multi-schema database installations without need for elevated (DBA) rights

$
0
0
I think that is a common problem and being able to control who executes each changeset is a good option. 

It would make the output of updateSql more complex because you wouldn't be able to execute that directly, but we could add comments in there when there is a change to who is running the changeSet. You couldn't collect the sql for each user in a separate file because the order can matter, it will still need to be a single sql file, just with comments that need to be watched for.

Rather than setting "runAs"  where you would define the username, I'm wondering if it should be "connection" where you set it to a key you define that maps to a separate connection which can have it's own username and URL. For example:

<changeSet id="1" author="Marek" connection="sys"> ...
<changeSet id="2" author="Marek" connection="backup_server"> ...
<changeSet id="3" author="Marek"> ...
<changeSet id="4" author="Marek" connection="standard_user"> ...

That would allow cross-database changeSets and also an abstraction on the usernames so if your usernames are different between dev and qa for example, it can still work.

It would add some confusion on what the default schema/catalog is. For example, if changeSet 1 above is a createTable and define a schemaName attribute, does liquibase create the table in the sys schema or the schema that the "default" connection uses?

Create a Jira issue and set the fix version to 4.0. I don't think it is a change that I would want to put into the 3.x versions, but it would be a good 4.0 feature.

Nathan

Re : Allow multi-schema database installations without need for elevated (DBA) rights

$
0
0

Thank you for answer.


> It would make the output of updateSql more complex

In case of oracle and sql*plus/sqldeveloper it is possible to use connect command like this:

connect user1/pswd1@conn_str1
sql_1;
connect user2/pswd2@conn_str1
sql_2;
sql_3;
connect user1/pswd1@conn_str1
sql_4;


> Rather than setting "runAs"  where you would define the username, I'm wondering if it should be "connection"

"connection" is more general solution and makes that feature even more flexible.


> It would add some confusion on what the default schema/catalog is


I think this behaviour should remain as it is today.
There must be one central schema/catalog.
Default schema/catalog location is "Default connection" which can be overrided by argument "--defaultSchemaName="


Marek

Re : Some Liquibase-related componentry for your perusal


Re : Allow multi-schema database installations without need for elevated (DBA) rights

Re : Microsoft Azure SQL DB - issue updating with a changelog xml file

$
0
0
Thanks for the information. I had removed the PK from the table since other databases have issues with key length that was limiting the size of the path and id columns.

I created https://liquibase.jira.com/browse/CORE-2086 to track a fix to automatically add the index on Azure.

Re : Liquibase-mysql

$
0
0
Can you try it with a newer driver version? If you are still seeing problems let me know.

Nathan

Re : MySql: DateTime size doesn't get picked by createTable / addColumn changesets

$
0
0
This is fixed for the upcoming 3.3.0 release. 

Nathan

Re : Attribute 'onUpdateSQL' is not allowed to appear in element 'preConditions'

$
0
0
The tag is onSqlOutput= FAIL or TEST or IGNORE

Nathan

Re : Auto-Increment Precondition

$
0
0
There is no built-in autoIncrementExists or similar precondition. Your best option is probably to find the correct SQL and use a <sqlCheck> precondition. 

Or use failOnError="false" in the <changeSet> tag and just ignore the error. That tends to be a bit more dangerous, though, since you don't know the actual error that is being skipped.

Nathan

Re : Strange things with Java 8

$
0
0
That is very strange. The TAG reserved word is included in redshift extension directly, so it's not a driver version difference. It is just doing a "redshiftReservedWords.contains(tableName.toUpperCase())" call.

Was it just TAG that was the problem? 

Nathan

Re : How to apply programatically only change sets which wasn't run?

$
0
0
It is probably an issue with the changeset "path" being different. Part of unique identifier of each changeset is the path, and is stored in databasechangelog. If the way you reference the changeSet changes, the path can be different and so seem to be a new changeset.

If you "select * from databasechangelog" how does the path compare to the output that lists the current path?

Nathan

Re : preConditions doesn't work

$
0
0
I'll be looking at it this week for the 3.2.3 release.

Nathan

Re : Validation and Output

Re : Strange things with Java 8

$
0
0
This was the SQL it tried to execute:

SELECT FILENAME,AUTHOR,ID,MD5SUM, DATEEXECUTED,ORDEREXECUTED, EXECTYPE,DESCRIPTION,COMMENTS, TAG,LIQUIBASE FROM public.databasechangelog_ analytics ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC

And because it's run on redshift, where TAG is a reserved keyword, it needs to have double-quotes. Exactly as we had the bug half a year ago.

Re : Microsoft Azure SQL DB - issue updating with a changelog xml file

Viewing all 2993 articles
Browse latest View live


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