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

Re : Generation of empty changelog

$
0
0
Nothing to specify the schema on the connection url worked.

However the command line defaultSchemaName parameter did the job.
The database I'm currently working on does only have one schema, so this was enough.

I guess that when I will move to the other database I will have to generate multiple change logs and merge them manually.

Regarding schema, I also found the option changelogSchemaName which was helpful.

Re : Invalid content was found starting with element 'preconditions' - with onFail="MARK_RAN"

$
0
0
I'm not sure how I missed that, but that fixed it, thank you!

checking environment before executing the script

$
0
0

I am very new to liquibase. Currently we have the following requirement. Some of the scripts should be executed based on environment. For example 

update application_properties value="123" where key="abc" ..this script should be executed in DEMO not in production. how do we solve this issue in Liquibase.

Re : checking environment before executing the script

Extending JdbcDatabaseSnapshot

$
0
0
I am writing an extension for Interbase. The class liquibase.snapshot.JdbcDatabaseSnapshot includes some database specific code in method getUniqueConstraints (createSql). Is there a way to extend this class to replace this method?

generateChangeLog fails due to this specific method..

Thanks,

Re : Why DateType in SQL Server 2008 is converted as SMALLDATETIME?

$
0
0
This should be fixed in the upcoming 3.2 release. Good you have a workaround for now.

Nathan

Re : Non-existing referenced sql files doesn't report error

Re : ORA-00911: invalid character

$
0
0
I have the same issue. I am following the sample change list from http://www.liquibase.org/documentation/sql_format.html but the ; is causing an error.

If I remove the ; my update goes through. However, if I have multiple statements, I need to use ; to separate them,except the last statement shouldnt have a ; 

Am I doing something wrong or is this a known issue/bug? Is there a workaround?

Dynamic property value to be loaded from a external file into the DatabaseChangeLog file

$
0
0
Hi,

Can we load property values dynamically from an external properties file into the DatabaseChangeLog file

Liquibase table partitioning

$
0
0
I have table scripts (xml) in liquibase designed for partitioned table spaces. Can I use the mapping.properties file to point all these partitioned tablespaces to a single tablespace?

Re : Dynamic property value to be loaded from a external file into the DatabaseChangeLog file

Re : Dynamic property value to be loaded from a external file into the DatabaseChangeLog file

$
0
0
Hi Nathan,

I had a look at this page but the issue is the property value which i am loading from an external file through ANT, how can i access those properties call then inside the changelog xml file.

Support for OrientDB NoSQL

$
0
0
Hi guys,
Any plans to support OrientDB NoSQL dbms?

www.orientdb.org

Lvc@

Re : Adding comments to changesets no longer works reliably

$
0
0
Should I open a ticket for this?

Re : Version 3.1.1 writing status results to stderr?

$
0
0
I can turn that off on each step, and had to do that with the database update.

I was trying to find a way to know automatically when the update fails, and it seemed that Liquibase was reporting 0 even when an update failed.

However, as I was outlining the scenario to post it here, I noticed that my wrapper scripts to the update call that are not properly capturing and reporting the exit code from Liquibase.

So in summary, I'll be able to get what I need from the exit codes, thanks!




How to avoid liquibase evaluating columns inside an IF EXISTS BEGIN block even when false

$
0
0
We are using liquibase formatted SQL (and need to stay in this format for the time being) and it has been going well, but I just encountered an issue that I cannot figure out how to get around.

We have had a lot of `IF EXISTS (proc) DROP PROC` statements and those seem to work fine.

But, one of the developers just added a check for a column on a table; the SQL executes properly directly against MSSQL but fails when ran as Liquibase.


The logic is if the table contains a given column, then update the values in that column. Liquibase appears to be properly capturing the result of the IF statement, but it seems it still tries to evaluate the validity of the condition inside of it.

Here is the desired Query:

  1. -- changeset damon.overboe:test-if-exists-3 endDelimiter:\nGO runOnChange:true
  2. IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='good_table_name AND COLUMN_NAME='bad_column_name')
  3. BEGIN
  4.     UPDATE good_table_name SET bad_column_name = 1
  5. END
  6. GO
I've tried with `BEGIN` and `BEGIN;` and both give the same output:
 Reason: liquibase.exception.DatabaseException: Error executing SQL IF ...
%< ----- snip ---- >%
 Invalid column name 'bad_column_name'.

I also tried using
  1. IF (SELECT count(*) FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='good_table_name' AND COLUMN_NAME='bad_column_name') <> 0
  2. ...
And get the same result.

And I have tried dropping the BEGIN and END blocks:

  1. -- changeset damon.overboe:test-if-exists-4 endDelimiter:\nGO runOnChange:true
  2. IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='good_table_name AND COLUMN_NAME='bad_column_name')
  3.     UPDATE good_table_name SET bad_column_name = 1
  4. GO


So, to prove it's not the IF statement's syntax, I added two tables, damon_test_table_should_persist and damon_test_you_shouldnt_see_me, then ran the following two changesets

  1. -- changeset damon.overboe:test-if-exists-1 endDelimiter:\nGO runOnChange:true
  2. IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='good_table_name' AND COLUMN_NAME='bad_column_name')
  3. BEGIN
  4.     -- IF should be false, so this table should not be dropped
        DROP TABLE damon_test_table_should_persist
  5. END
  6. GO

  7. -- changeset damon.overboe:test-if-exists-2 endDelimiter:\nGO runOnChange:true
  8. IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='good_table_name' AND COLUMN_NAME='bad_column_name')
  9. BEGIN
  10.     -- IF should be true, so this table should be dropped
        DROP TABLE damon_test_you_shouldnt_see_me
  11. END
  12. GO

Both of those ran successfully, so I don't think Liquibase is having an issue with the syntax, I think it's just evaluating the code inside the IF block.

This command errs as expected (table does not exist, it was properly dropped):
  1. $ sqlcmd -Q "use mydb; select * from damon_test_you_shouldnt_see_me"
  2. Changed database context to 'mydb'.
  3. Msg 208, Level 16, State 1, Server *****, Line 1
  4. Invalid object name 'damon_test_you_shouldnt_see_me'.

and this command passes as expected (table does exist):

  1. $ sqlcmd -Q "use mydb; select * from damon_test_table_should_persist"
  2. Changed database context to 'mydb'.
  3. ID        
  4. -----------
  5. (0 rows affected)

SUMMARY:
It seems that Liquibase is properly evaluating and running the IF blocks when needed, but, it seems it's also diving into the IF blocks and evaluating them, whether they should be ran. How can I avoid this?

Error on insert documentation on value param

$
0
0
I am not sure but i think i found an mistake in the documentation

it is written
  1. <changeSet author="liquibase-docs" id="insert-example"> <insert catalogName="cat" dbms="h2, oracle" schemaName="public" tableName="person"> <column name="address" type="varchar(255)"/> </insert> </changeSet>


But it could be like this

  1.     <column name="address" value="BlahBlah"/>


Like the stackoverflow shows

Same fight for UPDATE

Re : informix drop first - alter tables wrong syntax

$
0
0
Looking at this, It looks like informix does support double quotes around object names. Do you know the error you were getting? It seems like the SQL would be valid, but I don't have an informix db to test with off hand.

Nathan

Re : informix drop first - alter tables wrong syntax

$
0
0
Yes, I've posted the invalid SQL with the error:
ALTER TABLE "informix"."tablename" DROP CONSTRAINT "contraintname": A syntax error has occurred.

You've said that double quotes are allowed. But thats the problem. Here is a valid Informix SQL statement
ALTER TABLE informix.tablename DROP CONSTRAINT contraintname

If you can produce Liquibase generated SQL statements I will test it and mark all invalid parts.

P.S.: I still get an error in Jira if i whant to create tickets. Can you delete my user so I can reregister again
username: meleagros
group: jira-users
You are not authorised to perform this operation. Please log in. 

Thanks

Liquibase doesn't create or replace view using sqlFile

$
0
0
I'm trying to create or replace view using sqlFile not createView xml tag - and it doesn't created in database.
But the sql in file is the same as createView is generate.

Please see my question on stackoverflow

Thanks!

Viewing all 2993 articles
Browse latest View live


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