liquibase

Liquibase include with context

扶醉桌前 提交于 2019-12-07 16:21:01
问题 I need to include files in a databaseChangeLog, but these files may not exist, depending on the installation. My idea was to use something like includes with context, so Liquibase will only try to open the file when the appropriate context is given: <include file=”myFile” context=”myContext”/> But context is not used in an include tag, and Liquibase fails because the file is not present. I’ll rather not use includeAll because I need the files to be included at specific parts of my main file.

Id generation issue with Hibernate, liquibase and hsqldb

霸气de小男生 提交于 2019-12-07 14:41:14
问题 I've created a table using liquibase: <createTable tableName="employees"> <column name="id" type="bigint"> <constraints primaryKey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> </createTable> The following sql ddl query is generated: CREATE TABLE employees (id BIGINT NOT NULL, name VARCHAR(50) NOT NULL, CONSTRAINT PK_EMPLOYEES PRIMARY KEY (id)); The corresponding entity: @Entity @Table(name="employees") public class

Define Changeset for insert query in liquibase

穿精又带淫゛_ 提交于 2019-12-07 12:37:32
问题 I have two table as following : CREATE TABLE StudentMaster ( sId SERIAL, StudentName VARCHAR(50) ); CREATE TABLE StudentClassMap ( studnetId BIGINT UNSIGNED NOT NULL, studentClass VARCHAR(10), FOREIGN KEY (studnetId) REFERENCES StudentMaster (sId) ); This is my insert query. INSERT INTO StudentMaster (studentName) values ('Jay Parikh'); INSERT INTO StudentClassMap (studnetId, studentClass) values ((SELECT sId from StudentMaster where studentName='Jay Parikh'), 'M.Sc. 1st Year'); I want to

Liquibase includeAll tag is ignored

こ雲淡風輕ζ 提交于 2019-12-07 10:34:41
问题 Here we go.. We have a Spring Boot 1.4.0 application and we're using Liquibase 3.5.1 for our DB management. All of our individual changeset files are located in /src/main/resources/db/changelog and they have the following naming schema: [semanticVersion]-[descriptor].yml The master changelog, however, is located inside a runtime dependency. db.changelog-master.yaml databaseChangeLog: - changeSet: id: 1.0.1 author: atlassian changes: - createTable: //code omitted for brevity - includeAll: path

PostgreSQL Check Constraint in Liquibase

笑着哭i 提交于 2019-12-07 08:58:32
问题 I am wanting to create a check constraint in Liquibase on a PostgreSQL database table for an integer data type column that follows this logic: int_value >= 0 AND int_value <= 6 What is the proper XML request to make this happen? 回答1: This should be the way: <column name="int_value" type="INT" > <constraints checkConstraint="CHECK (int_value >= 0 AND int_value <= 6)"/> </column> However, current Liquibase (3.5.1) ignores checkConstraint attribute. There is a pull request, but it is added only

Liquibase does not generate consistent data difference of two databases

青春壹個敷衍的年華 提交于 2019-12-07 08:24:01
问题 I'm trying to generate migration with diffChangeLog. And it looks like Liquibase detects data changes only when table schema was modified. In other words if you have two DBs with same table, and you will insert or update rows in this table, Liquibase do nothing on diffChangeLog event with --diffTypes="data" parameter. But if toy create new table and insert rows in this table Liquibase generate inserts perfectly. Here are steps that I have made during my research: 1) Run two DBs: >sudo docker

Using Liquibase extensions with Maven

纵然是瞬间 提交于 2019-12-07 07:43:16
问题 I am trying to use Liquibase Oracle extensions from maven-liquibase-plugin but I'm not able to get it working. I have no issue with the same changeLog file from the command line, but in Maven I get the following error message SEVERE 21/11/11 14:49:liquibase: Error thrown as a SAXException: Unknown Liquibase extension: dropTrigger. Are you missing a jar from your classpath? The changelog file I'm using <?xml version="1.0" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www

“Unexpected error running Liquibase: Unknown Reason” liquibase 3.3.5 and grails war file

三世轮回 提交于 2019-12-07 05:35:27
This is the command I am running: java -jar /root/liquibase/liquibase.jar \ --driver=com.mysql.jdbc.Driver \ --logLevel=debug \ --changeLogFile=migrations/changelog.xml \ --classpath=/usr/share/tomcat7/lib/mysql.jar:/var/lib/tomcat7/webapps/myApp.war \ --url="jdbc:mysql://127.0.0.1:3306/mydb" \ --username=myuser \ --password=mypass \ --contexts=MYCONTEXT \ update this fails with the following unhelpful error message: Unexpected error running Liquibase: Unknown Reason SEVERE 9/9/15 2:23 PM: liquibase: Unknown Reason java.lang.AbstractMethodError at liquibase.database.DatabaseFactory.register

No inverse to liquibase.change.core.RawSQLChange created

…衆ロ難τιáo~ 提交于 2019-12-07 04:57:28
问题 The problem consist in: When play the command maven, the seems problem find in https://liquibase.jira.com/browse/CORE-465, but is that 2009, can marked with "Cannot Reproduce", i'm use one file .xml type liquibase with one changeSet, but many createTable, addPrimaryKey, rollback, addForeignKeyConstraint, this file create always tables and your respective constraints, but i'm make a rollback this wrong happened, i'm tired find for Internet, then can't found solution for the problem, are you

Liquibase Hibernate Plugin Does Not Work

丶灬走出姿态 提交于 2019-12-07 04:31:27
问题 As described here (https://github.com/liquibase/liquibase-hibernate/issues/74) I'm having an issue getting the liquibase-hibernate extension to work properly. I think I have everything setup, but it seems like I keep running into weird problems. I feel like I'm missing something simple, but I think I've followed all the instructions as provided. I'm using liquibase 3.3.2, Hibernate 4.3.0.Final, java 1.7.0_71 and the liquibase-hibernate4-3.5.jar. My CLASSPATH environmental variable is empty,