Questions tagged [liquibase-sql]

113 questions
7
votes
2 answers

Liquibase: ERROR: CREATE DATABASE cannot run inside a transaction block

I am trying to create a db on PostgreSQL using liquibase. This is my dbchangelog file
Pratheesh
  • 565
  • 4
  • 19
5
votes
2 answers

how do you use a liquibase parameter in an insert statement?

There is a liquibase parameter in Spring boot, let's say: spring.liquibase.parameters.val1 = value1 I want to use this parameter in a sql file like this: insert into table1 (name, value) values ("nameOfValue", ${val1}); unfortunately, the only…
Greg
  • 1,227
  • 5
  • 23
  • 52
5
votes
0 answers

What benefit does liquibase "splitStatements" provide?

liquibase version being used - org.liquibase:liquibase-core:3.8.2. (not pro version) Liquibase documents (1 & 2) says below about splitStatements (defaults to true) Set to false to not have Liquibase split statements on ;'s and GO's. Defaults to…
samshers
  • 1
  • 6
  • 37
  • 84
4
votes
1 answer

Liquibase CSV loadData fails with quoted string containing a comma

I am trying to load CSV file into SQLserver table using Liquibase change log set. When saved XLSX file as CSV file, column containing comma saved in double quotes (please see 3rd value below), this is fine as per standards but liquibase is ignoring…
SKARVA Bodavula
  • 903
  • 11
  • 17
3
votes
0 answers

Liquibase : Creating table with column Array of Varchar(100)

Does Liquibase allow us to create a table column as an Array of nvarchar(100) using XML or YAML changesets. I mean it is possible to do that within some databases natively. For example in H2…
3
votes
1 answer

Understanding the behaviour of logicalFilePath in liquibase

One of my changesets had a logicalFilePath which was incorrect(two changesets accidentally had the same logicalFilePath) and upon editing the logicalFilePath in an existing changeset, liquibase update failed with an error of duplicate column, which…
3
votes
3 answers

Force liquibase to current_timestamp instead of now()

Using liquibase-core:3.6.3 with MySQL. For the first time I have to use a timestamp(3) for a column instead on default timestamp. As my timestamp columns are not nullable, if no DEFAULT value is set, the current_timestamp is added (either directly…
luso
  • 2,812
  • 6
  • 35
  • 50
3
votes
1 answer

Liquibase - Generating Change Logs

I want Liquibase, to generate a changelog, from this DB 'testing'. Is it possible? I have an existing database already, with its tables and data inside. jdbc:mysql://localhost:3306/testing Now, I want Liquibase, to generate a changelog, from this…
Hendra
  • 115
  • 3
  • 9
2
votes
1 answer

Liquibase executing sql script even if dbms is set

I'm trying to use Liquibase for different db vendors and for each one of them I have different sql scripts. What I was trying to do is this:
User1254
  • 85
  • 5
2
votes
2 answers

liquibase maven plugin UUID vs BINARY(255)

I use the liquibase-maven-plugin to generate the database migration scripts. But liquibase generates the UUID id fields as BINARY(255). This in itself is not a problem as the IDs for new entities are generated by hibernate. So database support for…
aminator
  • 396
  • 7
  • 18
2
votes
1 answer

Passing parameters in sqlfile tag in liquibase 4.0

I am making a simple CI/CD pipeline in which there are some sql files that i need to run on aws RDS using liquibase. Here schema name can be different and will depend on the branch from which the code is pulled. Sample sql in createSchema.sql file…
Akash tiwari
  • 213
  • 1
  • 10
2
votes
1 answer

How to schedule mysql event with help of liquibase?

I am using liquibase to manage db for my spring boot application. Now I want to schedule one recurring event on db. But I want to use liquibase for that. My event is as follows: CREATE EVENT IF NOT EXISTS event12 ON SCHEDULE EVERY 10 SECOND STARTS…
2
votes
1 answer

Liquibase unique constarint is not applied for a column named 'name' but works for any other columns

I wanna make two columns unique and i've created changelist with two addUniqueConstraint's cause when i try to list required columns within one addUniqueConstraint columnNames section it ins't worked. So, i've specified addUniqueConstraint for…
2
votes
1 answer

On Fail Message for SQL Formatted ChangeSets

I can add preconditions to formatted SQL scripts, like the docs say: --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM my_table but I can't seem to add an onFailMessage or onErrorMessage to…
12345ieee
  • 420
  • 1
  • 4
  • 15
2
votes
2 answers

Liquibase ignores autoIncrement="true" for Oracle DB

I generated a schema/tables via the DDL that Hibernate generated which was correct: create table cat_component.organisation ( id number(19,0) generated as identity, archived number(1,0), is_in_avaloq_group number(1,0) not null, …
Georgi
  • 189
  • 2
  • 12
1
2 3 4 5 6 7 8