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

Re : Formatted SQL with a comment.

$
0
0
It looks like it needs a ":" after --comment

--comment: INSERT TABLE

I put in a fix for 3.3.1 to make the colon optional.

Nathan

Re : Error executing SQL --rollback drop table test: Invalid SQL type: sqlKind = UNINITIALIZED

$
0
0
No problem, glad you straightened it out. I should add code to detect formatted sql file with sqlFile to reduce confusion.

Nathan

Re : MySQL 5.6 keywords `partition' not quoted as a column name

$
0
0
Thanks. I added CORE-2136 and the fix will go out with 3.3.1.

Nathan

Re : Liquibase 2.0.5 does not seem to commit between changesets against MySQL 5.5

Re : Formatted SQL with a comment.

$
0
0
Adding a ":" works, thank you very much Nathan.

Here is my formatted sql that works:

$ cat ddl/test.sql
--liquibase formatted sql
--changeset ascii:001
--comment: Table for testing purposes
create table ascii (
    id int primary key,
    name varchar(255)
);
COMMENT ON COLUMN ascii.id IS 'ID OF Employee';
COMMENT ON COLUMN ascii.name IS 'NAME OF Employee';

--rollback drop table ascii;

--changeset ascii:002
--comment: Inserting test data
insert into ascii (id, name) values (1, 'first');
insert into ascii (id, name) values (2, 'second');
insert into ascii (id, name) values (3, 'third');

Re : MySQL 5.6 keywords `partition' not quoted as a column name

$
0
0
Great,

When do you plan to release the 3.3.1 ?

Evgeny

Re : MySQL 5.6 keywords `partition' not quoted as a column name

Problem with Preconditions in Version 3.3

$
0
0
today I tried to migrate one of our mysql databases. In my changelog there is 1 changeset with precondition columnExists. After all migration took 40 minutes to complete its work. After I monitored mysqls processlist it seems that columnExists precondition is executed for every table in the current schema.

Processlist displayed for example following info:
SHOW FULL COLUMNS FROM `TABLE_XYZ` FROM `appdb01` LIKE '%'

my condition is like that...
<not>
    <columnExists 
      schemaName="APPDB01"  
      tableName="BASE__WEB_USERS" 
      columnName="EMAIL"/>
</not>

For a small database containing a few tables this might not be a problem, but we have 26.000 tables in our schema, so this is a serious problem.

While processing the changelog liquibase calls the table list from the database Before I gave up (after 20 Minutes) threre were 5 messages in the processlist, that liquibase fetched a full table list

SHOW FULL TABLES FROM `appdb01` LIKE '%'

Is there a way to tell liquibase it should use all the given information to shorten execution time?

Thanks and Regards Rainer


Re : Problem with Preconditions in Version 3.3

$
0
0
I am starting to look at ways to improve the general snapshot process with 4.0. For the upcoming 3.3.1, I did make a couple changes that may help. I'm only seeing one SHOW FULL TABLES now and it doesn't expand to LIKE '%', it keeps it isolated to the table it is interested in. 

You are just using one precondition and it is a columnExits? Or do you have others?

Nathan

Multiple inserts in sqlFile do not fail as expected

$
0
0
We are using SqlServer with sqlFiles, and were testing the failure behavior. We expected a bad insert (string into an int col) to fail the changeSet and not write the record into the DATABASECHANGELOG table, but we got different results depending on where the failing insert was placed in the file. If the failing insert was first, the changeset failed as expected. If a passing insert was placed before the failing one, the entire changeset was rolled back (the passing insert was not in the table) but the changeset was logged as successful in the DATABASECHANGELOG table.

Has anyone had this happen before? Workarounds? Bug?

Liquibase 3.3 : insert SYSDATE into DATE field fails with 'ora-01858'

$
0
0
Hello
I've just upgraded to liquibase 3.3 (was in 1.9.5) because logging in debug mode didn't work.

Now logging works but I spent a lot of time to find why inserting the current date in a date field didn't work : 
Oracle 11g2 : "VER_DATE DATE"

INSERT INTO DWH_GTO.DWP_VERSION (VER_ID_VERSION_MAJOR, VER_ID_VERSION_MINOR, VER_LIBELLE_VERSION, VER_DATE) VALUES ('3', '0', 'INFOCENTRE V3.00', 'SYSDATE')

Liquibase.exception.DatabaseException: java.sql.SQLDataException: ORA-01858: a non-numeric character found where a digit was expected
This was working before.

And this unexpectedly works :
INSERT INTO DWH_GTO.DWP_VERSION (VER_ID_VERSION_MAJOR, VER_ID_VERSION_MINOR, VER_LIBELLE_VERSION, VER_DATE) VALUES ('3', '0', 'INFOCENTRE V3.00', 'SYSTIMESTAMP')

I've not found anything about that in the liquibase documentation. I believe it's a Locale date problem, then how to format the date as expected?

Regards
Frederic

Calling sql scripts with some parameters

$
0
0
Hi,
I'm using Oracle CDC for which I have scripts to add columns, create tables... 
With liquibase (3.3) I have to call those scripts with the  <sqlFile> tag.
I can call them while I'm connected to the database connection where the published tables are stored.

My problem is that I need to have the source database reference also, as the Oracle commands needs it to create the link between source and target tables.

I already have the parameters in properties file, and can connect to the target tables scheme.

Is there a way to pass some parameters to the sql script in order to tell it what is the source scheme it needs? 

Best regards,
Frederic

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

$
0
0
I have 4 db_users (on different oracle instances) and uses Ant to call 4 targets. So I call 4 times liquibase having for each a connection and separate changesets files. As I manage scripts by versions (a folder by version), i can easily see which changes are related.
Moreover I tag each database at each version even if nothing has change for one of them, so I can rollback to any version without error.

Re : Calling sql scripts with some parameters

$
0
0
Same thing to be able to change for example the tablespaces used depending on the target database:

<createTable tableName="THE_TABLE_NAME" tablespace="${ONE_TABLESPACE}">

with MY_TABLESPACE name defined in some properties.

Is this goal already reachable?

javadoc for liquibase 3.3


Re : Calling sql scripts with some parameters

Re : Liquibase 3.3 : insert SYSDATE into DATE field fails with 'ora-01858'

$
0
0
Are you using an <insert> tag? Or is it a raw <sql> block?

Nathan

Re : javadoc for liquibase 3.3

Re : Multiple inserts in sqlFile do not fail as expected

$
0
0
Liquibase should try to start a transaction at the beginning of the changeSet and only commit it and the insert into databasechangelog at the end. Could you post an example of the files you are using?

Nathan

Re : Multiple inserts in sqlFile do not fail as expected

Viewing all 2993 articles
Browse latest View live


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