liquibase

Liquibase with multiple schemas

烂漫一生 提交于 2019-12-07 04:26:34
问题 I have a software wich uses multiple schemas. I made db.changelog-master.xml to maintain different releases and db.changelog-S16.xml to current sprint (it's currently sprint 16 going on). db.changelog-S16.xml is looking like this: <?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns

Create function from SQL script by Liquibase

纵饮孤独 提交于 2019-12-07 01:57:10
问题 Project configuration: data base - MySQL 5.7 orm - Hibernate 4.3.11.Final / JPA 1.3.1.RELEASE Liquibase 3.4.2 My problem dont exist when i run script from workBeanch only from Liquibase. <changeSet author="newbie" id="function_rad2deg" dbms="mysql,h2"> <sqlFile encoding="utf8" path="sql/function_rad2deg.sql" relativeToChangelogFile="true" splitStatements="false" stripComments="false"/> </changeSet> My sql script looks like this: DROP FUNCTION IF EXISTS rad2deg; DELIMITER // CREATE FUNCTION

Adding a non-nullable column to existing table fails. Is the “value” attribute being ignored?

时光总嘲笑我的痴心妄想 提交于 2019-12-06 20:24:45
问题 Background: we have a Grails 1.3.7 app and are using Liquibase to manage our database migrations. I am trying to add a new column to an existing table which is not empty. My changeset looks like this: changeSet(author: "someCoolGuy (generated)", id: "1326842592275-1") { addColumn(tableName: "layer") { column(name: "abstract_trimmed", type: "VARCHAR(455)", value: "No text") { constraints(nullable: "false") } } } Which should have inserted the value 'No text' into every existing row, and

Managing Liquibase with GitFlow development model

﹥>﹥吖頭↗ 提交于 2019-12-06 15:39:34
We are using the git flow model for our development and trying to integrate liquibase for managing the database versioning efficiently. The problem comes when a developer is working on a feature branch and has made a DB script which is executed on his database and another developer's database, but it is not yet part of any release so it is not yet tagged. Now that feature is tested and becomes part of release and we tag the changeset and execute it on production. The questions is how to rollback the changes made on the developer's machine because there was no tag defined at the moment when the

Liquibase execution order of changeset files when using includeAll with classpath*:

巧了我就是萌 提交于 2019-12-06 13:14:29
I am using liquibase (3.1.1) in a spring environment (3.2.x) and load the changesets via the inlcudeAll tag in a master file. There I use the "classpath*:/package/to/changesets" as path. <?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> <includeAll path="classpath*:/package/to/changesets"/>... I use a naming strategy like "nnn_changesetname.xml" to keep

Two MySQL Database on Jhipster

我与影子孤独终老i 提交于 2019-12-06 10:06:29
问题 I am using jHipster and it is great as most of the boiler-plate Java code is automatically generated. In my application, I need two MySQL databases. How do I configure them? Should I have two different database config files for the two different schemas? Also, jHipster uses Liquibase, so how do I change my DatabaseConfiguration class? 回答1: You will need to configure 2 datasources, 2 Hibernate sessions, 2 cache instances... This is going to be quite complex: first start with the datasources

Grails database-migration with property to be db agnostic

会有一股神秘感。 提交于 2019-12-06 09:53:31
Is there a way in the Grails-database migration plugin to define properties in migration files to be able to define database agnostic migration, like it is possible in Liquibase? I tried with: databaseChangeLog = { property([name:"boolean.type", value:"bit(1)",dbms:"mysql" ]) property([name:"boolean.type", value:"number(1,0)", dbms:"oracle"]) ... } an using it in the colum definition: changeSet(author: "me", id: "121112341-1") { createTable(tableName: "test_table") { ... column(name: "my_column", type: "${boolean.type}") ... } } but that does not work... In a Groovy file "${boolean.type}" is a

LiquiBase — Any way to output change log sql to a file in 2.0.5?

旧时模样 提交于 2019-12-06 05:09:17
问题 Currently I am integrating Liquibase with my spring application using liquibase.integration.spring.SpringLiquibase bean From java doc, tt is plausible to know there is an property sqlOutputDir to that bean class so that the sql can output to external file. However, the feature seems not exist in latest 2.0.5. So, the question is, what is the current equivalent method or function to output changeLog sql to external file, or the feature just have been totally removed forever? Please give a hint

Add new field to existing entity with JHipster

喜欢而已 提交于 2019-12-06 04:28:11
问题 I've a problem when I try to add a new field to an existing entity. I run this command yo jhipster:entity Libro and I choose [BETA] Yes, add more fields and relationships, but when I try to compile my project with ./mvnw I receive this error http://pastebin.com/SW1kpeDT I also try to follow the guideline in jhipster site but I have the same error. 回答1: It's normal (at least in beta) because the update operation changed the Liquibase migration file 20161022122700_added_entity_Libro.xml that

Maven: run plugin twice during a phase, interleaved with another plugin

守給你的承諾、 提交于 2019-12-06 04:25:56
问题 For our end-2-end test we need to execute the following logical flow: Create and set up e2e schema (user) in the database ( pre-integration-test ) Run Liquibase to initially populate the schema ( pre-integration-test ) Add e2e-specific test data to the DB tables ( pre-integration-test ) Start Tomcat ( pre-integration-test ) Run the web application in Tomcat ( integration-test ) using Protractor Shut down Tomcat ( post-integration-test ) Clean up the DB: drop the schema ( post-integration-test