Update one row in the table, using liquibase

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 not double quotes ” in the WHERE clause.

Liquibase or Flyway database migration alternative for Elasticsearch

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 exception) documents in ES is immutable: … Read more

Liquibase: How to set the default value of a date column to be “now” in UTC format?

Maybe this topic in the liquibase forum will help? I think defaultValueComputed will take a database specific function to express “now”. In mySQL it would be CURRENT_TIMESTAMP so it could look like this: <createTable tableName=”D_UserSession”> <column name=”ts” type=”TIMESTAMP” defaultValueComputed=”CURRENT_TIMESTAMP”/> </createTable> (Copied from the forum post.)

Java code changeset in liquibase

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 CustomChangeException { JdbcConnection dbConn = (JdbcConnection) arg0.getConnection(); try { … do funny stuff … } catch (Exception e) { // swallow the exception ! … Read more

Liquibase: How to Set Foreign Key(s) Constraint in Column Tag?

Use a nested <constraints> tag in your column tag. Example: <changeSet id=”SAMPLE_1″ author=”alice”> <createTable tableName=”employee”> <column name=”id” type=”int” autoIncrement=”true”> <constraints primaryKey=”true”/> </column> <column name=”first_name” type=”varchar(255)”/> <column name=”last_name” type=”varchar(255)”> <constraints nullable=”false”/> </column> </createTable> </changeSet> <changeSet id=”create address table” author=”bob”> <createTable tableName=”address”> <column name=”id” type=”int” autoIncrement=”true”> <constraints primaryKey=”true”/> </column> <column name=”line1″ type=”varchar(255)”> <constraints nullable=”false”/> </column> <column name=”line2″ … Read more

Spring boot – disable Liquibase at startup

The relevant property name has changed between Spring versions: For Spring 4.x.x: the liquibase.enabled=false application property disables Liquibase. For Spring 5.x.x: the spring.liquibase.enabled=false application property disables Liquibase. P.S. And for Flyway: Spring 4.x.x: flyway.enabled=false Spring 5.x.x: spring.flyway.enabled=false

List all liquibase sql types

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: BOOLEAN FirebirdDatabase: SMALLINT DerbyDatabase: SMALLINT InformixDatabase: BOOLEAN SybaseDatabase: BIT SybaseASADatabase: BIT tinyint MySQLDatabase: TINYINT SQLiteDatabase: TINYINT H2Database: TINYINT PostgresDatabase: SMALLINT … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)