question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at.. For example, compared to.. phpUnderControl Jenkins Hudson CruiseControl.rb ..and others, BuildBot looks rather.. archaic I'm currently playing with Hudson, but it is very Java-centric (although with this guide, I found it...
You might want to check out Nose and the Xunit output plugin. You can have it run your unit tests, and coverage checks with this command: nosetests --with-xunit --enable-cover That'll be helpful if you want to go the Jenkins route, or if you want to use another CI server that has support for JUnit test reporting. Sim...
Jenkins
225,598
112
Building my Jenkins/MSBuild solution gives me this error c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9): error : The OutputPath property is not set for project '<projectname>.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform fo...
I have figured out how it works (without changing sln/csproj properties in VS2013/2015). if you want to build .sln file: /p:ConfigurationPlatforms=Release /p:Platform="Any CPU" if you want to build .csproj file: /p:Configuration=Release /p:Platform=AnyCPU notice the "Any CPU" vs AnyCPU check the code analysis,...
Jenkins
15,134,384
110
I have a machine with Ubuntu 12.04 and have installed Jenkins ver. 1.424.6 using apt-get based on *this guide*, but there is a new version: New version of Jenkins (1.447.2) is available for download (changelog). If I press download, I get a jenkins.war file... but how do I use that for upgrading my current installatio...
You can overwrite the existing jenkins.war file with the new one and then restart Jenkins. This file is usually located in /usr/share/jenkins. If this is not the case for your system, in Manage Jenkins -> System Information, it will display the path to the .war file under executable-war.
Jenkins
11,062,335
110
How do I tell Jenkins/Hudson to trigger a build only for changes on a particular project in my Git tree?
If you are using a declarative syntax of Jenkinsfile to describe your building pipeline, you can use changeset condition to limit stage execution only to the case when specific files are changed. This is now a standard feature of Jenkins and does not require any additional configruation/software. stages { stage('Ng...
Jenkins
5,243,593
110
I've got an existing Hudson project that is configured and working. I need to duplicate the project so that I can have the original and then change the new one so that it points to a different source control. I don't want to manually recreate the build. How can i "copy & paste" or otherwise duplicate the exiting buil...
Click on "new job" and then select "Copy existing job" at the bottom. Then enter the name of the job you want to copy into the text field.
Jenkins
3,133,537
110
I am running Jenkins from user jenkins thats has $PATH set to something and when I go into Jenkins web interface, in the System Properties window (http://$host/systemInfo) I see a different $PATH. I have installed Jenkins on Centos with the native rpm from Jenkins website. I am using the startup script provided with th...
Michael, Two things: When Jenkins connects to a computer, it goes to the sh shell, and not the bash shell (at least this is what I have noticed - I may be wrong). So any changes you make to $PATH in your bashrc file are not considered. Also, any changes you make to $PATH in your local shell (one that you personally ssh...
Jenkins
5,818,403
108
I configured Jenkins in Spinnaker as follows and setup the Spinnaker pipeline. jenkins: # If you are integrating Jenkins, set its location here using the baseUrl # field and provide the username/password credentials. # You must also enable the "igor" service listed separately. # # If you have multi...
Finally, this post helped me to do away with the crumb problem, but still securing Jenkins from a CSRF attack. Solution for no-valid crumb included in the request issue Basically, we need to first request for a crumb with authentication and then issue a POST API calls with a crumb as a header along with authentication ...
Jenkins
44,711,696
108
I've installed jenkins and I'm trying to get into a shell as Jenkins to add an ssh key. I can't seem to su into the jenkins user: [root@pacmandev /]# sudo su jenkins [root@pacmandev /]# whoami root [root@pacmandev /]# echo $USER root [root@pacmandev /]# The jenkins user exists in my /etc/passwd file. Runnin su jenkin...
jenkins is a service account, it doesn't have a shell by design. It is generally accepted that service accounts shouldn't be able to log in interactively. I didn't answer this one initially as it's a duplicate of a question that has been moved to server fault. I should have answered rather than linked to the answer in...
Jenkins
18,068,358
107
Summary: Setting up Jenkins on OS X has been made significantly easier with the most recent installer (as of 1.449 - March 9, 2012), however managing the process of code signing is still very difficult with no straightforward answer. Motivation: Run a headless CI server that follows common best practices for running se...
Keychains need to be unlocked before they can be used. You can use security unlock-keychain to unlock. You can do that interactively (safer) or by specifying the password on the command line (unsafe), e.g.: security unlock-keychain -p mySecretPassword... Obviously, putting this into a script compromises the security o...
Jenkins
9,245,149
107
In a project I'm working on, we are using shell scripts to execute different tasks. Some are sh/bash scripts that run rsync, and some are PHP scripts. One of the PHP scripts is running some integration tests that output to JUnit XML, code coverage reports, and similar. Jenkins is able to mark the jobs as successful / f...
Modern Jenkins versions (since 2.26, October 2016) solved this: it's just an advanced option for the Execute shell build step! You can just choose and set an arbitrary exit value; if it matches, the build will be unstable. Just pick a value which is unlikely to be launched by a real process in your build.
Jenkins
8,148,122
103
I'm using the Jenkins Multiple SCM plugin to check out three git repositories into three sub directories in my Jenkins job. I then execute one set of commands to build a single set of artifacts with information and code drawn from all three repositories. Multiple SCM is now depreciated, and the text recommends moving t...
You can use the dir command to execute a pipeline step in a subdirectory: node('ATLAS && Linux') { dir('CalibrationResults') { git url: 'https://github.com/AtlasBID/CalibrationResults.git' } dir('Combination') { git url: 'https://github.com/AtlasBID/Combination.git' } dir('Combinatio...
Jenkins
40,224,272
102
I am invoking a Jenkins job remotely using: wget http://<ServerIP>:8080/job/Test-Jenkins/build?token=DOIT Here Test-Jenkins job is invoked and DOIT is the security token that I have used. Now I need to pass some parameters to the build.xml file of this job i.e. Test-Jenkins. I have not yet figured out how to pass the...
See Jenkins documentation: Parameterized Build Below is the line you are interested in: http://server/job/myjob/buildWithParameters?token=TOKEN&PARAMETER=Value
Jenkins
20,359,810
102
I have two jobs in jenkins, both of which need the same parameter. How can I run the first job with a parameter so that when it triggers the second job, the same parameter is used?
You can use Parameterized Trigger Plugin which will let you pass parameters from one task to another. You need also add this parameter you passed from upstream in downstream.
Jenkins
9,704,677
102
I am trying to integrate an external system with jenkins by REST API. Although I have done lots of google search on its API reference, I still cannot get a full list of jenkins REST API reference. Anybody knows about this?
Jenkins has a link to their REST API in the bottom right of each page. This link appears on every page of Jenkins and points you to an API output for the exact page you are browsing. That should provide some understanding into how to build the API URls. You can additionally use some wrapper, like I do, in Python, using...
Jenkins
25,661,362
101
With GitHub command I have: ssh -T git@github.com Hi (MyName)! You've successfully authenticated, but GitHub does not provide shell access. My connection with GitHub is ok (no problem), but with Jenkins I have this error: ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:Name-MysRepo/MyRepo.gi...
This error: stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly indicates that Jenkins is trying to connect to github with the wrong ssh key. You should: Determine the user that jenkins runs as, eg. 'build' or 'jenkins' Login on the jenkins host that is trying to do the clone - that is, ...
Jenkins
16,721,629
101
Jenkins won't execute any jobs. Having viewed this question, I have disabled all slave nodes but a simple job won't even run on the Master node. What is wrong?
The Jenkins admin console can run, even with the Master node offline. This can happen when Jenkins runs out of disk space. To confirm, do the following (with thanks to geekride - jenkins-pending-waiting-for-next-available-executor): go to Jenkins -> Manage Jenkins -> Manage Nodes examine the "master" node to see if it...
Jenkins
15,112,890
101
How do you access parameters set in the "This build is parameterized" section of a "Workflow" Jenkins job? TEST CASE Create a WORKFLOW job. Enable "This build is parameterized". Add a STRING PARAMETER foo with default value bar text. Add the code below to Workflow Script: node() { print "DEBUG: parameter foo = $...
I think the variable is available directly, rather than through env, when using Workflow plugin. Try: node() { print "DEBUG: parameter foo = ${foo}" }
Jenkins
28,572,080
100
I'm currently doing some evaluation on the Jenkins Pipeline plugin (formerly know as Workflow plugin). Reading the documentation I found out that I currently cannot retriev the workspace path using env.WORKSPACE: The following variables are currently unavailable inside a workflow script: NODE_LABELS WORKSPACE SCM-spec...
Since version 2.5 of the Pipeline Nodes and Processes Plugin (a component of the Pipeline plugin, installed by default), the WORKSPACE environment variable is available again. This version was released on 2016-09-23, so it should be available on all up-to-date Jenkins instances. Example node('label'){ // now you ar...
Jenkins
36,934,028
99
Does anyone know how to increase the the timeout window before Jenkins logs out a user? I'm looking to raise it to 1 day or so. I work in and out jenkins all day and we keep getting logged out between running of jobs. Added to this frustration, the 'stay logged in' checkbox doesn't seem to work either.
Jenkins uses Jetty, and Jetty's default timeout is 30 minutes. This is independent of authentication settings -- I use Active Directory but it's still this setting that affects timeouts. You can override the timeout by passing an argument --sessionTimeout=<minutes> to the Jenkins init script, or -DsessionTimeout=<minut...
Jenkins
26,407,541
98
Inside a groovy script (for a jenkins pipeline): How can I run a bash command instead of a sh command? I have tried the following: Call "#!/bin/bash" inside the sh call: stage('Setting the variables values') { steps { sh ''' #!/bin/bash echo "hello world" ''' } } Repla...
The Groovy script you provided is formatting the first line as a blank line in the resultant script. The shebang, telling the script to run with /bin/bash instead of /bin/sh, needs to be on the first line of the file or it will be ignored. So instead, you should format your Groovy like this: stage('Setting the variable...
Jenkins
44,330,148
97
I am user of AWS elastic beanstalk, and I have a little problem. I want to build my CSS files with less+node. But I don`t know how to install node in my dockerfile, when building with jenkins. Here is installation packages what I am using in my docker. I will be glad for any suggestions. FROM php:5.6-apache # Instal...
I think this works slightly better. ENV NODE_VERSION=16.13.0 RUN apt install -y curl RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ENV NVM_DIR=/root/.nvm RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} RUN . "$NVM_DIR/nvm.s...
Jenkins
36,399,848
96
I am running a Jenkins cluster where in the Master and Slave, both are running as a Docker containers. The Host is latest boot2docker VM running on MacOS. To allow Jenkins to be able to perform deployment using Docker, I have mounted the docker.sock and docker client from the host to the Jenkins container like this :-...
A Docker container in a Docker container uses the parent HOST's Docker daemon and hence, any volumes that are mounted in the "docker-in-docker" case is still referenced from the HOST, and not from the Container. Therefore, the actual path mounted from the Jenkins container "does not exist" in the HOST. Due to this, a ...
Jenkins
31,381,322
95
I have a submodule in a project in Jenkins. I've enabled the advanced setting to recursively update submodules. When I run the build, I see that the workspace has the files from the submodule. The problem is, it seems to be the first revision of the submodule. When I push changes (repository hosted on GitHub) Jenkins d...
Note that the Jenkins Git plugin 2.0 will have "advance submodule behaviors", which should ensure proper updates of the submodules: As commented by vikramvi: Advanced sub-modules behavior > "Path of the reference repo to use during submodule update" against this field , add submodule git url. Owen B mentions in th...
Jenkins
9,953,299
94
I have installed Jenkins executable on OSX, but now I want to stop it running. Whenever I kill it, no matter how, it just restarts immediately. I've tried using the exit command on the jenkins url: http://localhost:8080/exit which asks me to post the command, which I do, and the server shuts down as requested. But the...
Just unload the plist using launchctl sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Jenkins
6,959,327
94
I've been following this guide on configuring GitLab continuous integration with Jenkins. As part of the process, it is necessary to set the refspec as follows: +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* Why this is necessary is not explained in the post, so I b...
A refspec tells git how to map references from a remote to the local repo. The value you listed was +refs/heads/*:refs/remotes/origin/* +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*; so let's break that down. You have two patterns with a space between them; this just means you're giving multiple rule...
Jenkins
44,333,437
93
Sorry for the 'svn' style - we are in a process of migration from SVN to GIT (including our CI Jenkins environment). What we need is to be able to make Jenkins to checkout (or should I say clone?) the GIT project (repository?) into a specific directory. We've tried some refspecs magic but it wasn't too obvious to under...
In the new Jenkins 2.0 pipeline (previously named the Workflow Plugin), this is done differently for: The main repository Other additional repositories Here I am specifically referring to the Multibranch Pipeline version 2.9. Main repository This is the repository that contains your Jenkinsfile. In the Configure scre...
Jenkins
9,767,919
93
I need to know which branch is being built in my Jenkins multibranch pipeline in order for it to run steps correctly. We are using a gitflow pattern with dev, release, and master branches that all are used to create artifacts. The dev branch auto deploys, the other two do not. Also there are feature, bugfix and hotfix ...
The env.BRANCH_NAME variable contains the branch name. As of Pipeline Groovy Plugin 2.18, you can also just use BRANCH_NAME (env isn't required but still accepted.)
Jenkins
32,789,619
92
I recently updated the configuration of one of my hudson builds. The build history is out of sync. Is there a way to clear my build history? Please and thank you
Use the script console (Manage Jenkins > Script Console) and something like this script to bulk delete a job's build history https://github.com/jenkinsci/jenkins-scripts/blob/master/scriptler/bulkDeleteBuilds.groovy That script assumes you want to only delete a range of builds. To delete all builds for a given job, use...
Jenkins
3,410,141
92
I am creating a sample jenkins pipeline, here is the code. pipeline { agent any stages { stage('test') { steps { sh 'echo hello' } } stage('test1') { steps { sh 'echo $TEST' } ...
your first try is using declarative pipelines, and the second working one is using scripted pipelines. you need to enclose steps in a steps declaration, and you can't use if as a top-level step in declarative, so you need to wrap it in a script step. here's a working declarative version: pipeline { agent any s...
Jenkins
43,587,964
91
I have two Jenkins pipelines, let's say pipeline-A and pipeline-B. I want to invoke pipeline-A in pipeline-B. How can I do this? (pipeline-A is a subset of pipeline-B. Pipeline-A is responsible for doing some routine stuff which can be reused in pipeline-B) I have installed Jenkins 2.41 on my machine.
Following solution works for me: pipeline { agent { node { label 'master' customWorkspace "${env.JobPath}" } } stages { stage('Start') { steps { sh 'ls' } } stage ('Invoke_pipelin...
Jenkins
43,337,070
91
I've create a jenkins pipeline and it is pulling the pipeline script from scm. I set the branch specifier to 'all', so it builds on any change to any branch. How do I access the branch name causing this build from the Jenkinsfile? Everything I have tried echos out null except sh(returnStdout: true, script: 'git rev...
Use multibranch pipeline job type, not the plain pipeline job type. The multibranch pipeline jobs do posess the environment variable env.BRANCH_NAME which describes the branch. In my script.. stage('Build') { node { echo 'Pulling...' + env.BRANCH_NAME checkout scm } } Yields... Pulling...
Jenkins
42,383,273
91
I have a report file I'm generating, and I would like to be able to add the current build number to that file within a Jenkins job. Is there an environment variable or plugin I can use to get at the current build number?
BUILD_NUMBER is the current build number. You can use it in the command you execute for the job, or just use it in the script your job executes. See the Jenkins documentation for the full list of available environment variables. The list is also available from within your Jenkins instance at http://hostname/jenkins/env...
Jenkins
7,167,650
91
I run Jenkins in its own container. I use the command "nohup java -jar jenkins.war --httpsPort=8443". How do I shut it down safely? Right now, I use the kill command to kill the process.
Use http://[jenkins-server]/exit This page shows how to use URL commands.
Jenkins
10,238,604
89
I have the following code within a Jenkins pipeline: stage ('Question') { try { timeout(time: 1, unit: 'MINUTES') { userInput = input message: 'Choose server to publish to:', ok: '', parameters: [ [$class: 'hudson.model.ChoiceParameterDefinition', choices: 'pc-ensureint\nother-se...
The following code worked for me: echo userInput
Jenkins
43,866,369
88
I get this when running a lot of liquibase-scripts against a Oracle-server. SomeComputer is me. Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Waiting for changelog lock.... Liquiba...
Sometimes if the update application is abruptly stopped, then the lock remains stuck. Then running UPDATE DATABASECHANGELOGLOCK SET LOCKED=0, LOCKGRANTED=null, LOCKEDBY=null where ID=1; against the database helps. You may also need to replace LOCKED=0 with LOCKED=FALSE. Or you can simply drop the DATABASECHANGELOGLOCK...
Liquibase
15,528,795
412
I try to find documentation on the supported types that can be used in change log files. But cannot find it. Is there any document, site or something similar where I can find all types-specific issues. For example clob type is supported in databases with different types. And I have to use something like: <property name...
This is a comprehensive list of all liquibase datatypes and how they are converted for different databases: boolean MySQLDatabase: BIT(1) SQLiteDatabase: BOOLEAN H2Database: BOOLEAN PostgresDatabase: BOOLEAN UnsupportedDatabase: BOOLEAN DB2Database: SMALLINT MSSQLDatabase: [bit] OracleDatabase: NUMBER(1) HsqlDatabase: ...
Liquibase
16,890,723
122
I have searched for this answer on stack overflow, but I couldn't find any questions on this. I am new to Liquibase and want to learn Why Liquibase? When exactly one should use Liquibase in the project? I know that this is to keep all database changes in one place but the similar can be done by creating a simple SQL ...
The key differentiator between a self-managed schema create file and Liquibase (or other schema migration tools) is that the latter provides a schema changelog. This is a record of the schema changes over time. It allows the database designer to specify changes in schema & enables programmatic upgrade or downgrade of t...
Liquibase
29,760,629
118
Maven fires liquibase validation fail even no changes was made in changeset. My database is oracle. Situation: In DB changelog table was record for changeset <changeSet id="1" author="me" dbms="oracle">; Then by mistake i added another changeset <changeSet id="1" author="me" dbms="hsqldb"> Reruned liquibase scripts Ma...
If you're confident that your scripts correctly reflect what should be in the database, run the liquibase:clearCheckSums maven goal, which will clean it all up.
Liquibase
9,995,747
72
We're using Liquibase 3.2 with Java 6. Is there a way I can force Liquibase to recalculate checksums without re-running the same statements from our Liquibase files? In our database, I run this ... update DATABASECHANGELOG set md5sum = null where 1; However, when I run my Liquibase change scripts, certain executions...
Rather than clearing the checksums yourself using SQL, it will probably be better to let Liquibase do that by using the clearCheckSums command: https://docs.liquibase.com/commands/community/clearchecksums.html Removes current checksums from database. On next run checksums will be recomputed.
Liquibase
30,219,947
64
Is there a way in liquibase to create java code change set (i.e. provide a java class, which will receive a JDBC connection and will perform some changes in the database) ? (I know that flyway has such feature)
Yes, there is such feature. You can create a customChange: <customChange class="my.java.Class"> <param name="id" value="2" /> </customChange> The class must implements the liquibase.change.custom.CustomTaskChange interface. @Override public void execute(final Database arg0) throws CustomChangeExceptio...
Liquibase
11,987,460
59
I'm creating a link table which has 3 columns; id, product_id, tournament_id. Adding a uniqueConstraint to the "id" column is trivial, but I want to ensure that any pair of (product_id, tournament_id) is unique. The example at Liquibase.org shows <changeSet author="liquibase-docs" id="addUniqueConstraint-example"> <add...
You can read liquibase manual also similar problem you can find here In your case it should be: <changeSet author="liquibase-docs" id="addUniqueConstraint-example"> <addUniqueConstraint columnNames="product_id, tournament_id" constraintName="your_constraint_name" tableName="person" /> </...
Liquibase
28,192,652
46
I was hoping if someone could verify if this is the correct syntax and correct way of populating the DB using liquibase? All, I want is to change value of a row in a table and I'm doing it like this: <changeSet author="name" id="1231"> <update tableName="SomeTable"> <column name="Properties" value="1" /> <where...
The above answers are overly complicated, for most cases this is enough: <changeSet author="name" id="123"> <update tableName="SomeTable"> <column name="PropertyToSet" value="1" /> <where>otherProperty = 'otherPropertyValue'</where> </update> </changeSet> important to use single quotes ' and no...
Liquibase
16,627,627
42
For some reason there's no documentation on running liquibase inside Java code. I want to generate tables for Unit tests. How would I run it directly in Java? e.g. Liquibase liquibase = new Liquibase() liquibase.runUpdates() ?
It should be something like (taken from liquibase.integration.spring.SpringLiquibase source): java.sql.Connection c = YOUR_CONNECTION; Liquibase liquibase = null; try { Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(c)) liquibase = new Liquibase(YOUR_CHANG...
Liquibase
10,620,131
41
I am pretty new to ES. I have been trying to search for a db migration tool for long and I could not find one. I am wondering if anyone could help to point me to the right direction. I would be using Elasticsearch as a primary datastore in my project. I would like to version all mapping and configuration changes / data...
From this point of view/need, ES have a huge limitations: despite having dynamic mapping, ES is not schemaless but schema-intensive. Mappings cant be changed in case when this change conflicting with existing documents (practically, if any of documents have not-null field which new mapping affects, this will result in...
Liquibase
23,977,688
41
liquibase is a perfect alternative to hibernate's hbm2ddl_auto property if you are using xml-mapping. But Im using JPA annotation (hibernate annotations). Is it possible to use liquibase then?
Yes, Liquibase uses hibernate's metadata classes, which are the same whether you use xml mappings or annotations. You do need a hibernate config file to point liquibase to, but your mappings can be xml or jpa annotations. More information can be found at https://github.com/liquibase/liquibase-hibernate/wiki but you ca...
Liquibase
776,787
37
A lot of people are unsure how to fix logging for liquibase, either to the console or file. Is it possible to make liquibase log to slf4j?
There is, but it is a little bit obscure. Quoting Fixing liquibase logging with SLF4J and Log4J: There's The Easy Way, by dropping in a dependency: <!-- your own standard logging dependencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependen...
Liquibase
20,880,783
36
Following the quickstart on liquibase i've created a changeset (very dumb :) ) Code: <?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchange...
You should never modify a <changeSet> that was already executed. Liquibase calculates checksums for all executed changeSets and stores them in the log. It will then recalculate that checksum, compare it to the stored ones and fail the next time you run it if the checksums differ. What you need to do instead is to a...
Liquibase
1,148,663
36
We have a existing database in production. We have decided to use liquibase for all further updates and create any new database (like development or integration). We have created liquibase scripts based on the existing production schema (to create any new database like development, integration, etc). On top of that sc...
The process to put a existing database under liquibase control is the following: Create the initial changelog (that's what you did) Run liquibase using the command changelogSync. This will create the Liquibase tables and mark all change sets as being applied (this is what you missed) Add your change sets Run liquibase...
Liquibase
16,455,624
35
I've looked at both Liquibase and Flyway individually and on an individual comparison alone, Liquibase seems like the better tool for our needs. Some sources mention using both Liquibase and Flyway together. Liquibase seems to have everything Flyway has and more flexibility when it comes to rollbacks. The main advantag...
A small correction, before I answer question. The assumption Liquibase seems to have everything Flyway has isn't correct. Flyway shines when it comes to parsing SQL. You can use unmodified SQL files generated by your native tools containing all kinds of complexity like PL/SQL packages and procedures, MySQL delimiter ...
Liquibase
39,044,851
34
How can I disable checksum validation in Liquibase? It looks like Liquibase does not provide such feature. Would it be hard to modify Liquibase to achieve that? Your opinion, please.
Try adding validCheckSum with the literal ANY to the top of your changeSet, like this: <changeSet> <validCheckSum>ANY</validCheckSum> <!-- the rest of your changeSet here --> </changeSet>
Liquibase
30,579,550
33
I have two tables declared as follows: <changeSet author="istvan" id="country-table-changelog"> <createTable tableName="country"> <column name="id" type="uuid"> <constraints nullable="false" unique="true" /> </column> <column name="name" type="varchar"> <constraints n...
You can do this by using properties that are defined depending on the current DBMS. <property name="uuid_type" value="uuid" dbms="postgresql"/> <property name="uuid_type" value="uniqueidentifier" dbms="mssql"/> <property name="uuid_type" value="RAW(16)" dbms="oracle"/> <property name="uuid_function" value="uid.uuid_ge...
Liquibase
42,361,350
30
I have configured the maven pluggin for liquibase as specified in maven configuration. Now created a changeset like :- <changeSet id="changeRollback" author="nvoxland"> <createTable tableName="changeRollback1"> <column name="id" type="int"/> </createTable> <rollback> <dropTable tableName="changeRollback...
Rollback tags are designed to checkpoint your database's configuration. The following commands will roll the database configuration back by 3 changesets and create a tag called "checkpoint": mvn liquibase:rollback -Dliquibase.rollbackCount=3 mvn liquibase:tag -Dliquibase.tag=checkpoint You can now update the database,...
Liquibase
11,131,978
28
I'm trying to setup the database schema and some test data with liquibase for some tests. Each test has a separate changelog which setup the schema and some specific data for the test. In order to make my tests working, I need to drop the schema before each test and fill it with new test data. However, it seems that th...
There is a spring.liquibase.dropFirst config property. Maybe this is what you're looking for?
Liquibase
35,997,898
27
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 (...
Use the valueComputed attribute: <changeSet author="unknown" id="insert-example-2"> <insert tableName="StudentClassMap"> <column name="studentId" valueComputed="(SELECT sId from StudentMaster where studentName='Jay Parikh')"/> <column name="studentClass" value="McSc. 1st Year"/> </insert> </chan...
Liquibase
22,356,313
26
I'm trying to add a lot of records (currently located in an Excel file) into my DB using Liquibase (so that I know how to do it for future DB changes) My idea was to read the excel file using Java, and then fill the ChangeLogParameters from my Spring initialization class like this: SpringLiquibase liqui = new SpringLiq...
I would say that Liquibase is not the ideal tool for what you want to achieve. Liquibase is well-suited to managing the database structure, not the database's data. If you still want to use Liquibase to manage the data, you have a couple of options (see here) - Record your insert statements as SQL, and refer to them...
Liquibase
12,143,994
26
I am having problems changing a column length in my postgres db with liquibase. I have a table account with a field description varchar(300). I want to change it to varchar(2000). I have dropped and recreated the primary key in the same file so I don't have permissions issues or schema / db names or anything like this...
You can increase the size of your column like this: <changeSet author="liquibase" id="sample"> <modifyDataType columnName="description" newDataType="varchar(2000)" tableName="account"/> </changeSet>
Liquibase
37,319,193
25
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 entities in our domain model are tied to a specific catalog name.) So, for that reason, as well as to ensure that the tests ...
The problem lies in @DataJpaTest you are using. See the Documentation of @DataJpaTest By default, tests annotated with @DataJpaTest will use an embedded in-memory database (replacing any explicit or usually auto-configured DataSource). The @AutoConfigureTestDatabase annotation can be used to override these settings. ...
Liquibase
57,153,091
25
I want to update the type of a column named "password". At the moment it has type NVARCHAR(40) and I want it to be of type NVARCHAR(64). This is what I did: <changeSet id="1 - change password length" author="chris311"> <update tableName="tablename"> <column name="password" type="NVARCHAR(64)"/> </update...
You're using the wrong refactoring operation. Try modifyDataType
Liquibase
18,765,121
25
I read liquibase's best practices, specifically for managing stored procedures: Managing Stored Procedures: Try to maintain separate changelog for Stored Procedures and use runOnChange=”true”. This flag forces LiquiBase to check if the changeset was modified. If so, liquibase executes the change again. What do they ...
What we do is something like this: \---liquibase | changelog.xml | procedures.xml | +---procedures procedure_one.sql procedure_two.sql changelog.xml simply includes procedures.xml. Inside procedures.xml we then have something like this: <changeSet author="arthur" id="1" r...
Liquibase
39,989,749
24
I need to set up liquibase for two datasources in Spring, at the moment it seems that only one liquibase set up is possible and you can choose for which data source.
If you are using spring boot, here is the setup which can help you: Configuration class: @Configuration public class DatasourceConfig { @Primary @Bean @ConfigurationProperties(prefix = "datasource.primary") public DataSource primaryDataSource() { return DataSourceBuilder.create().build(); }...
Liquibase
43,523,971
24
In Liquibase, I define a table with a column of type BIT(1) <changeSet author="foobar" id="create-configuration-table"> <createTable tableName="configuration"> <column autoIncrement="true" name="id" type="BIGINT(19)"> <constraints primaryKey="true" /> </column> <column name="acti...
Answering my own question as I figured this out right after I posted it. To insert into a BIT(1) column, you need to define the value as valueBoolean <insert> <column name="active" valueBoolean="true"/> </insert>
Liquibase
31,252,711
24
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") { ...
Short answer The "value" attribute will not work if you are adding a not-null constraint at the time of the column creation (this is not mentioned in the documentation). The SQL generated will not be able to execute. Workaround The workaround described in the question is the way to go. The resulting SQL will be: Add t...
Liquibase
8,904,316
24
Can I automatically convert Liquibase changelog files in the XML format to the YAML format?
There is nothing built in, but you can easily do it with a little scripting. Some starting points: liquibase.parser.ChangeLogParserFactory.getInstance().getParser(".xml", resourceAccessor).parse(...) will return a DatabaseChangeLog object representing the changelog file. liquibase.serializer.ChangeLogSerializerFactory...
Liquibase
22,968,572
23
I have standalone application. It’s on java, spring-boot, postgres and it has liquibase. I need to deploy my app and liquibase should create all tables, etc. But it should do it into custom schema not in public. All service tables of liquibase (databasechangelog and databasechangeloglock) should be in custom schema to...
To solve this, we need to run a SQL statement that creates the schema during Spring Boot initialization at the point when DataSource bean had been already initialized so DB connections can be easily obtained but before Liquibase runs. By default, Spring Boot runs Liquibase by creating an InitializingBean named SpringLi...
Liquibase
52,517,529
23
I'm using Liquibase 3.3.5 to update my database. Having contexts is a nice way to only execute specific parts of the changelog. But I don't understand, why ALL changesets are executed, when no context is provided on update. Consider the following example: changeset A: context=test changeset B: no context changeset C: ...
This is just how Liquibase works - if you do an update and don't specify a context, then all changesets are considered as applicable to that update operation. There were a couple of ways that this could have been implemented, and the development team had to pick one. if you don't specify a context during an update o...
Liquibase
30,783,353
23
We are supporting several microservices written in Java using Spring Boot and deployed in OpenShift. Some microservices communicate with databases. We often run a single microservice in multiple pods in a single deployment. When each microservice starts, it starts liquibase, which tries to update the database. The prob...
We're running liquibase migrations as an init-container in Kubernetes. The problem with running Liquibase in micro-services is that Kubernetes will terminate the pod if the readiness probe is not successful before the configured timeout. In our case this happened sometimes during large DB migrations, which could take a...
Liquibase
61,387,510
22
What is the correct syntax to alter the table and adding multiple columns at a time using liquibase xml. The official document gives the example for adding only one column : <changeSet author="liquibase-docs" id="addColumn-example"> <addColumn catalogName="cat" schemaName="public" tableName=...
Both of those examples will work.
Liquibase
33,022,737
22
I want to use liquibase but when I want to let it run with command line this happens: PS C:\Users\Ferid\Downloads\liquibase-3.6.0-bin> .\liquibase Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/filter/Filter ...
One of the required libraries is missing from the library folder. See the bug report link below where another user had the same issue. It appears 3.6.1 is still missing slf4j-api-1.7.25 in the lib folder and I still receive an error invoking liquibase via cli. You have three options: Get the library yourself [here...
Liquibase
50,487,054
21
I want mock data for integration tests by liquibase changeset, how to make that to not affect real database? I found partial idea from here, but I am using springboot and I hope there is simpler solution.
You can use liquibase's context parameter. For example create changeset which will have inserts loaded from sql file and specify the context for it. Something like this: <changeSet id="test_data_inserts" author="me" context="test"> <sqlFile path="test_data.sql" relativeToChangelogFile="true" /> </changeSet> and in...
Liquibase
47,036,222
21
I'm using Postgres DB and for migration I'm using Liquibase. I have an ORDERS table with the following columns: ID | DATE | NAME | CREATOR | ... I need to add a new column which will hold the user who has last modified the order - this column should be not-nullable and should have default value which is the CREATOR. F...
Since no one answered here I'm posting the way I handled it: <changeSet id="Add MODIFY_USER_ID to ORDERS" author="Noam"> <addColumn tableName="ORDERS"> <column name="MODIFY_USER_ID" type="BIGINT"> <constraints foreignKeyName="ORDERS_MODIFY_FK" referencedTableName="USERS" referencedColumnNames="I...
Liquibase
35,172,172
21
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 database, but it did not work out. I realized that in H2 database != Schema, so I tried to put a default schema to test_c...
Default schema is PUBLIC For the record, the Commands page of the H2 Database site for the SET SCHEMA command says: The default schema for new connections is PUBLIC. That documentation also notes that you can specify the default schema when connecting: This setting can be appended to the database URL: jdbc:h2:test;S...
Liquibase
23,877,972
20
I need to do some data migration, which is too complex to do it in a liquibase changeset. We use spring That's why I wrote a class implementing the liquibase.change.custom.CustomTaskChange class. I then reference it from within a changeset. All is fine to this point. My question is: Is it possible to get access to the ...
I'm currently running through this problem as well...After hours of digging, I found 2 solutions, no AOP is needed. Liquibase version: 4.1.1 Solution A In the official example of customChange https://docs.liquibase.com/change-types/community/custom-change.html In CustomChange.setFileOpener, ResourceAccessor actually i...
Liquibase
32,826,600
20
I'm trying to use liquibase for generating the changeLog, starting by snapshoting the current state of my database. Environment details: OS: Windows 7 32 x86, Java JDK 1.7, mysql jdbc driver from MySQL liquibase 2.0.5. I run the following from command line: liquibase --driver=com.mysql.jdbc.Driver --changeLogFile=....
Just specify the database name with the --url flag like ZNK said: --url="jdbc:mysql://mysql.mysite.com/database_name_here"
Liquibase
12,449,824
20
I'm currently working on a liquibase.xml file to create table table_a. One of my fields is <column name="state" type="ENUM('yes','no')"> I'm using postgresql as my DBMS. is there anything like enum data type? I've read in this like http://wiki.postgresql.org/wiki/Enum that postgresql doesn't have such data type. CREAT...
Well of course PostgreSQL has an enum type (which is clearly documented in the link you have shown and the manual). I don't think Liquibase "natively" supports enums for PostgreSQL, but you should be able to achieve it with a custom SQL: <changeSet id="1" author="Arthur"> <sql>CREATE TYPE my_state AS ENUM ('yes','no...
Liquibase
5,133,423
20
I need to map two columns of entity class as json in postgres using spring data jpa. After reading multiple stackoverflow posts and baeldung post , How to map a map JSON column to Java Object with JPA https://www.baeldung.com/hibernate-persist-json-object I did configuration as below. However, I am facing error "ERROR:...
For anyone who landed here because they're using JdbcTemplate and getting this error, the solution is very simple: In your SQL statement, cast the JSON argument using ::jsonb or CAST. E.g. String INSERT_SQL = "INSERT INTO xxx (id, json_column) VALUES(?, ?)"; becomes String INSERT_SQL = "INSERT INTO xxx (id, json_column...
Liquibase
65,478,350
19
I am using yaml, but I guess it is almost the same as xml or json. I found that you can use addForeignKeyConstraint, but I want to add the constraint at table creation, not altering an existing table. How should I do that? Can I do something like this? - changeSet: id: create_questions author: Author ...
I never used the YAML format, but in an XML changelog you can do this: <column name="user_id" type="int"> <constraints nullable="false" foreignKeyName="fk_questions_author" references="users(id)"/> </column> The equivalent YAML should be something like this: - column: name: use...
Liquibase
39,793,397
19
I try to create a new table via a liquibase changeset that looks like: <createTable tableName="mytable"> <column name="id" type="number" autoIncrement="true"> <constraints primaryKey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"/> <column name...
Change type="number" to type="BIGINT". i,e <createTable tableName="mytable"> <column name="id" type="BIGINT" autoIncrement="true"> <constraints primaryKey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"/> <column name="description" type="varchar(25...
Liquibase
20,473,575
19
Can anyone tell me the difference between specifying a defaultValue="0" vs a defaultValueNumeric="0" in a changeset? It's for a bigint column. http://www.liquibase.org/manual/add_default_value doesn't really go into detail here.
The difference is that defaultValue puts quotes around the value in the resulting SQL. Many database will interpret inserting '42' into a numeric field as the number 42, but some fail. defaultValueNumeric tells liquibase it is a number and therefore will not be quoted and will work on all database types.
Liquibase
7,267,925
19
I need to update my data that have html tag inside so wrote this on liquibase <sql> update table_something set table_content = " something <br/> in the next line " </sql> it apparently doesn't work on liquibase ( i got loooong errors .. and meaningless). I tried to remove <br/> and it works. my question is, is it poss...
As the liquibase author mentions here you'll need to add CDATA section inside <sql>. In your particular example that would become: <sql><![CDATA[ update table_something set table_content = " something <br/> in the next line " ]]></sql>
Liquibase
1,082,371
19
First, a little background. I have a set of Java applications, some based on JPA, some not. To create my databases I am currently using Hibernates schema export to generate create scripts for those using JPA. Those not using JPA I generate the scripts by hand. These are then run during application installation using AN...
Liquibase handles it quite fine. It looks at your database at the current state, finds unapplied changesets and generates an SQL script with update command in sql output mode. Using a proper database migration tool instead of Hibernate generator is the way to go in any case, sooner or later you'll end up with a situati...
Liquibase
14,482,644
18
I update scheme and initial data in spring context using the following beean: <bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase"> <property name="dataSource" ref="dataSource" /> <property name="changeLog" value="classpath:db/changelog/db.changelog-master.xml" /> <property name="dropFi...
I think if you change your Maven path from <changeLogFile>src/main/resources/db/changelog/db.changelog-master.xml</changeLogFile> to <changeLogFile>db/changelog/db.changelog-master.xml</changeLogFile> and update db.changelog-master.xml file for all included files to use path relative to src/main/resources directory, ...
Liquibase
16,605,099
17
I'm trying to execute the following changeSet in liquibase which should create an index. If the index doesn't exist, it should silently fail: <changeSet failOnError="false" author="sys" id="1"> <createIndex unique="true" indexName="key1" tableName="Table1"> <column name="name" /> </createIndex> </chang...
In the answer given by Nathen Voxland, he recommended the more correct approach of using a precondition to check the state of the database, before running the changeset. It seems to me that ignoring a failure is a bad idea.... Means you don't fully control the database configuration.... The "failOnError" parameter allo...
Liquibase
10,913,133
16
I need a list of the generic data types available in Liquibase. Where can I find these in the documentation. I need them when adding columns to my table: <changeSet author="liquibase-docs" id="addColumn-example"> <addColumn catalogName="cat" schemaName="public" tableName="person"> <c...
Liquibase uses the standard JDBC datatypes - here is one reference, from http://db.apache.org/ojb/docu/guides/jdbc-types.html DBC Type Java Type CHAR String VARCHAR String LONGVARCHAR String NUMERIC java.math.BigDecimal DECIMAL java.math.BigDecimal BIT boolean BOOLEAN b...
Liquibase
23,742,361
16
I tried to remote debug a maven plugin for a liquibase project with Intellij. IDEA is highlighting the wrong source code line. I manually built and installed the plugin in my local maven repository from sources in my Intellij project. Intellij version is 11.1.3 and maven version is 3.0.4 running on Ubuntu 12.04. For de...
For me, whenever IntelliJ is highlighting the wrong line, it was always because the version of the JAR/classes being used to run the application differs from my source files - i.e. different version of the sources were used to build the JAR and/or classes. You are going to have to be sure that you are working from the ...
Liquibase
12,824,532
16
I'm creating a new table, like this: <createTable tableName="myTable"> <column name="key" type="int" autoIncrement="true"> <constraints primaryKey="true" primaryKeyName="PK_myTable" nullable="false"/> </column> <column name="name" type="nvarchar(40)"> <constraints nul...
It isn't documented, but I looked at the source code and it appears that if you do not specify, there is no constraint added to the column. One way you can check this yourself is to use the liquibase updateSql command to look at the SQL generated.
Liquibase
32,889,080
16
I'm currently working on a Spring project which uses Hibernate and Liquibase. What I am trying to achieve is to update Liquibase's changelog automatically every time I build the project. It's supposed to generate a diff based on my current productive database and my updated Hibernate Entities. But the problem I have is...
I finally figured it out! You can use the Exec type to execute commands in the command line which subsequently starts a new process. You can find more information in the documentation. This is the solution I ended up with: task updateChangeLog(type: Exec) { commandLine 'gradle', 'diffChangeLog' } updateChangeLog.de...
Liquibase
30,972,713
16
I'm using the dropwizard-migrations module for liquibase db refactoring. See the guide here: http://dropwizard.codahale.com/manual/migrations/ When I run java -jar my_project.jar db migrate my_project.yml I get the following error: ERROR [2013-09-11 20:53:43,089] liquibase: Change Set migrations.xml::11::me failed. Er...
The solution is: <changeSet id="3" author="me"> <sql> DROP TRIGGER IF EXISTS add_current_date_to_my_table ON my_table; CREATE TRIGGER add_current_date_to_my_table BEFORE UPDATE ON my_table FOR EACH ROW EXECUTE PROCEDURE change_update_time(); </sql> <rollback> DROP TRIGGER add_current...
Liquibase
18,751,174
16
I am utilising Liquibase (www.liquibase.org) into our MVC3 SQL Server 2008 project to manage database migration/changes. However I'm stumbling on the first hurdle: Connecting to Microsoft SQL Server instance. I am looking at the quick start tutorial on the liquibase site, but exchanging the mysql for sql server DB I ru...
Create a properties file called liquibase.properties containing the following: classpath=C:\\Program Files\\Microsoft SQL Server 2005 JDBC Driver\\sqljdbc_1.2\\enu\\sqljdbc.jar driver=com.microsoft.sqlserver.jdbc.SQLServerDriver url=jdbc:sqlserver://localhost:1433;databaseName=test username=myuser password=mypass chang...
Liquibase
8,990,467
16
We have couple of data schemas and we investigate the migration to Liquibase. (One of data schemas is already migrated to Liquibase). Important question for us is if Liquibase supports dry run: We need to run database changes on all schemas without commit to ensure we do not have problems. In case of success all dat...
You can try "updateSQL" mode, it will connect db (check you access rights), acquire db lock, generate / print SQL sentences to be applied (based on db state and you current liquibase change sets) also it will print chageset id's missing in current state of db and release db lock.
Liquibase
21,847,482
15
Recently we started using Liquibase. It didn't occurred yet but we imagined what would happen if two developers commits changes in the change log file to the shared Git repository. How to solve or avoid a merge conflict? To broaden this question some what: What is the recommended workflow using Liquibase in combinatio...
At my company, the way we use liquibase prevents these situations from occurring. Basically, you create a separate liquibase file for each change. We name the files after the JIRA ticket that originated the change with a little descriptive text. Each of these files, we put in a folder for the version of the system they...
Liquibase
24,449,879
15
In my project I just tried upgrading liquibase from 3.2.2 to 3.4.2 (both the jars and the maven plugin). EDIT: same for upgrade to 3.3.x. As a consequence, starting the application now gives the following error: Caused by: liquibase.exception.ValidationFailedException: Validation Failed: 4 change sets check sum s...
You could also use the <validCheckSum> sub-tag of the <changeSet> to add the new checksums as valid checksums. Also, checkout the comments on the bug CORE-1950. You could put the log level to "debug" on both of your liquibase versions and see if you can find differences in the log output of the checksum creations. Use...
Liquibase
34,655,157
15
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 crea...
This is expected behavior. Somewhere in your changelog, you have a changeset that uses raw SQL. You didn't include it here, but the actual contents don't matter - as long as it is raw SQL, Liquibase cannot determine how to 'undo' or rollback that change. The way to fix this is to look at that changeset and add a rollba...
Liquibase
32,166,653
15
I'm using Spring Boot and liquibase for database migrations and refactorings. I'm having some exceptions (mostly database exception) in my changesets every now and then, but liquibase shares too little information in the default log level. For example it doesn't tell me the exact SQL statement it executed or the name o...
It's a limitation of Spring Boot's code that adapts Liquibase's own logging framework to use Commons Logging. I've opened an issue so that we can improve the adapter. Now that the issue has been fixed, you can use logging.level.liquibase to control the level of Liquibase logging that will be output.
Liquibase
30,047,389
15
I can run Liquibase changelog through maven build (liquibase:update goal) without any problems. Now I'd like Liquibase to use database credentials and URL loaded from a properties file (db.properties) depending on the selected Maven profile: |-- pom.xml `-- src `-- main `-- resources |-- local ...
I managed to get this working. The key was to use the maven filter element in conjunction with the resource element as explained in Liquibase Documentation. Also it's important to include the resources goal in the maven command: mvn resources:resources liquibase:update -Plocal This is the file hierarchy I used: |-- po...
Liquibase
22,355,725
15
Is there a way to write a liquibase addColumn changeset so it generates sql like ALTER TABLE xxx ADD COLUMN yyy AFTER zzz; I mean, is there a way to add an equivalent of "after column zzz" in liquibase jargon?
With Liquibase 3.1 there are new "afterColumn", "beforeColumn" and "position" attributes on the column tag. The documentation at http://www.liquibase.org/documentation/column.html was just updated to include them.
Liquibase
21,179,943
15
I want to use a custom TestExecutionListener in combination with SpringJUnit4ClassRunner to run a Liquibase schema setup on my test database. My TestExecutionListener works fine but when I use the annotation on my class the injection of the DAO under test no longer works, at least the instance is null. @RunWith(SpringJ...
I had a look at the spring DEBUG logs and found that when I omit my own TestExecutionListener spring sets a DependencyInjectionTestExecutionListener in place. When annotating the test with @TestExecutionListeners that listener gets overwritten. So I just added the DependencyInjectionTestExecutionListener explicitly wi...
Liquibase
15,704,091
15
Im trying to change a project a bit, by upgrading it with Liquibase. Its a Java EE project. So im using the liquibase-maven-plugin. So far i have in my pom.xml: <plugin> <groupId>org.liquibase</groupId> <artifactId>liquibase-maven-plugin</artifactId> <version>...
Edit: The problem was resolved by replacing driver: org.postgresql.Driver with driver=org.postgresql.Driver in the liquibase.properties file. Original Answer: You have added the postgresql driver as a dependency of your webapp. But when maven plugins run, they have their own classpath, which is different to your webap...
Liquibase
14,501,332
15
I'm trying to implement liquibase in an existing SpringBoot project with MYSQL database. I want to be able to generate changesets which specify the differences when an entity is changed. What I've done: I've added liquibase dependencies and the gradle liquibase plugin in my build.gradle file. After making a domain chan...
The solutions is to write a gradle task which invokes liquibase diffChangeLog Create a liquibase.gradle file in the project root directory, add liquibase-hibernate extension and write a gradle task that invokes the liquibase diffChangeLog command. configurations { liquibase } dependencies { liquibase group: 'org....
Liquibase
35,716,378
14
I wonder if it possible to get maximum column value from a certain table and set it as start sequence value with no pure sql. The following code doesn't work: <property name="maxId" value="(select max(id)+1 from some_table)" dbms="h2,mysql,postgres"/> <changeSet author="author (generated)" id="1447943899053-1"> ...
So, such a solution worked for me: <changeSet author="dfche" id="1448634241199-1"> <createSequence sequenceName="user_id_seq" startValue="1" incrementBy="1"/> </changeSet> <changeSet author="dfche" id="1448634241199-2"> <sql dbms="postgresql">select setval('user_id_seq', max(id)+1) from jhi_user</sql> <sql db...
Liquibase
33,888,587
14
I'm comparing two databases using liquibase integrated with ant. But the output it is generating is like generic format. It is not giving sql statements. Please can anyone tell me how compare two databases using liquibase integrated with ant or command line utility.
Obtaining the SQL statements, representing the diff between two databases, is a two step operation: Generate the XML "diff" changelog Generate SQL statements Example This example requires a liquibase.properties file (simplifies the command-line parameters): classpath=/path/to/jdbc/jdbc.jar driver=org.Driver url=jdbc...
Liquibase
8,397,488
14