All Questions
91
questions
17votes
2answers
8kviews
H2 update with join
As development DB I am using MySQL, and for tests I am using H2 database.
The following script works in MySQL very well, but it is fails on H2.
UPDATE `table_a`
JOIN `table_b` ON `table_a`.id=`...
15votes
2answers
22kviews
Using Liquibase to initialize in-memory H2 for unit tests in Spring Boot application
I've used in-mem databases in Spring JPA tests many times, and never had a problem. This time, I have a bit more complex schema to initialize, and that schema must have a custom name (some of the ...
12votes
2answers
23kviews
H2: how to set default schema and database?
I am using Liquibase for my database updates and testing it against H2.
I am using Spring to configure the properties. I use
dataSource.setUrl("jdbc:h2:mem:test_common");
to connect to test_common ...
10votes
3answers
9kviews
Liquibase drop constraint without knowing it's name
We use liquibase to keep track of our database changes..
First changeSet contains those lines:
<column name="SHORT_ID" type="INTEGER">
<constraints unique="true" />
</column>
...
8votes
1answer
12kviews
Alter sequence in H2
I'm using Postgres database in production and H2 for tests.
I want to create a new sequence for an existing table - so in Liquibase I wrote this:
<changeSet id="Add sequence for BOOKS" author="...
8votes
2answers
9kviews
H2 Database: How to have lowercase for tablename?
I want to keep all my tablenames as lowercase. example person
I use Liquibase to setup my database and it looks like
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
...
8votes
1answer
6kviews
org.h2.jdbc.JdbcSQLException: Cannot parse "TIMESTAMP" constant "${now}";
I'm struggling with this problem from a few days without really understanding the reason behind it.
Working with Liquibase, PostgreSQL and H2DB (for testing).
Liquibase is working fine when working ...
8votes
1answer
11kviews
Configure Spring boot with H2 database and Liquibase
I am using Spring boot2, I am trying to configure a Unit Test using H2 + Liquibase + JUNIT.
I think that liquibase is not executing the changeLog files and apply the SQL Commands, the unit test does ...
7votes
1answer
14kviews
H2 and MySQL compatibility issues
i am using H2 for my integration tests with Liquibase and it seems that there are compatibility issues.
A simple change column function does not pass on H2 where it works perfectly on MySQL ...
6votes
2answers
15kviews
How do I get liquibase to skip table creation if it already exists with liquibase formatted sql?
This is what I have
--preconditions onFail:CONTINUE
--preconditions not tableExists tableName:QRTZ_CALENDARS schemaName:dbo
CREATE TABLE dbo.QRTZ_CALENDARS (
SCHED_NAME VARCHAR (120) NOT NULL ,
...
6votes
3answers
5kviews
Liquibase: Change a INT autoincrement column to BIGINT using modifyDataType refactoring with H2 database
I have a primary key column which is an INT column which I would like to change to a BIGINT. Our test and production environment uses MySQL, but for unit tests we use the embedded H2 database.
I have ...
6votes
2answers
5kviews
Spring boot testing with liquibase fails
I have been trying for quite some time to figure out a solution for my problem, to no avail.
Anyway, i have a bunch of integration tests (in a nonstandard directory testRegression parallel to the ...
5votes
1answer
3kviews
Incompatible sequence names between Liquibase and Hibernate JPA for PostgreSQL and H2
I have an app running with standard Hibernate JPA and Liquibase for generating the db. I use H2 for testing and PostgreSQL when running.
My problem is I can't seem to get this setup to work nicely ...
4votes
1answer
4kviews
Liquibase primary key is created twice on H2
At start problem is only with H2 database. On other database (MySQL) it works just fine without problems.
Configuration generated by (jHipster):
profile: dev
spring:
profiles:
active: dev
...
3votes
2answers
6kviews
How do I run a Liquibase changeset on one type of db but then have LIquibase ignore it for another type?
I”m using Gradle 2.7, MySQL 5.5.46, and the Gradle Liquibase plugin (v 1.1.1). I’m running my LIquibase script on both my H2 (v. 1.4.190) in-memory database and my MySql database. How do I configure ...