liquibase

Force Liquibase to map Blob to BYTEA on PostgreSQL

感情迁移 提交于 2021-02-07 13:13:04
问题 How to tell Liquibase to map BLOB datatype to BYTEA on PostgreSQL? It seems that Hibernate people has taken over and adapted the tool to their needs: https://liquibase.jira.com/browse/CORE-1863 , however, EclipseLink don't support oid's and the bug seems to be still open: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337467 I need to use EclipseLink, and I need to use blobs with PostgreSQL. I'd like to use Liquibase, is it possible to make those things work together? 回答1: You have two options

Force Liquibase to map Blob to BYTEA on PostgreSQL

梦想与她 提交于 2021-02-07 13:12:57
问题 How to tell Liquibase to map BLOB datatype to BYTEA on PostgreSQL? It seems that Hibernate people has taken over and adapted the tool to their needs: https://liquibase.jira.com/browse/CORE-1863 , however, EclipseLink don't support oid's and the bug seems to be still open: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337467 I need to use EclipseLink, and I need to use blobs with PostgreSQL. I'd like to use Liquibase, is it possible to make those things work together? 回答1: You have two options

Liquibase - insert rows with uuid

末鹿安然 提交于 2021-02-06 15:16:30
问题 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 nullable="false" unique="true" /> </column> </createTable> </changeSet> <changeSet author="istvan" id="region-table-changelog"> <createTable tableName="region"> <column name="id" type="uuid" > <constraints nullable="false" unique=

Liquibase - insert rows with uuid

試著忘記壹切 提交于 2021-02-06 15:15:46
问题 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 nullable="false" unique="true" /> </column> </createTable> </changeSet> <changeSet author="istvan" id="region-table-changelog"> <createTable tableName="region"> <column name="id" type="uuid" > <constraints nullable="false" unique=

Is there a configuration for removing LiquiBase DATABASE CHANGELOGLOCK automatically after a certain time or on app restart?

北战南征 提交于 2021-02-04 21:51:22
问题 We have SpringBoot 2 driven HA java application in which we use PostgreSQL underneath. For certain reasons like unexpected crashes or Exceptions, Liquibase ends up with a stale DATABASECHANGELOGLOCK which was never released. This results in subsequent deployments of the app failing with app waiting for the change lock and then exiting as follows: 2020-03-04T11:10:31.78+0200 SELECT LOCKED FROM public.databasechangeloglock WHERE ID=1 2020-03-04T11:10:31.78+0200 Waiting for changelog lock....

Is there a configuration for removing LiquiBase DATABASE CHANGELOGLOCK automatically after a certain time or on app restart?

故事扮演 提交于 2021-02-04 21:50:05
问题 We have SpringBoot 2 driven HA java application in which we use PostgreSQL underneath. For certain reasons like unexpected crashes or Exceptions, Liquibase ends up with a stale DATABASECHANGELOGLOCK which was never released. This results in subsequent deployments of the app failing with app waiting for the change lock and then exiting as follows: 2020-03-04T11:10:31.78+0200 SELECT LOCKED FROM public.databasechangeloglock WHERE ID=1 2020-03-04T11:10:31.78+0200 Waiting for changelog lock....

Liquibase does not add interval to current_timestamp

北慕城南 提交于 2021-01-29 08:37:50
问题 I use postgres DB, I faced an issue with liquibase adding interval to the current time as default value: <property name="expired" value="current_timestamp + interval '60 days'" dbms="postgresql"/> <addColumn tableName="user"> <column name="expired" type="timestamp" defaultValueDate="${expired}"> <constraints nullable="false"/> </column> </addColumn> Expired property always returns current date without adding 60 days. Is it possible? Or is there some mistakes in value field? Thank you in

Liquibase sql precondition is not checked

橙三吉。 提交于 2021-01-29 07:54:38
问题 I have multiple changelogs and one of the change log has the precondition on it to check if table exists, if so, skip running the migration. My change log file --liquibase formatted sql --preconditions onFail:MARK_RAN onError:MARK_RAN --precondition-sql-check expectedResult:0 select COUNT(*) C from dba_tables where UPPER(table_name) = 'PERSON' and upper(owner) = 'INT' --changeset nvoxland:3 create table int.person ( id int not null primary key, firstname varchar(80), lastname varchar(80) not

why maven liquibase:diff -DdiffExcludeObjects parameter does not work

天涯浪子 提交于 2021-01-29 04:20:59
问题 I have a project that is using liquibase for database sync. When I use maven liquibase for generating a changelog, I want to exclude some database objects whose names start with oauth_ My maven goal is like this liquibase:diff -DdiffExcludeObjects="table:oauth_.*" But when I execute the goal, the generated changelog includes these changesets: <changeSet author="aliakbarazizkhani (generated)" id="1470077228335-4"> <dropTable tableName="oauth_access_token"/> </changeSet> <changeSet author=

Liquibase's sqlFile command being ignored for SQL server

a 夏天 提交于 2021-01-28 06:41:53
问题 I am trying to use the sqlFile command of liquibase in my changelog. I have the following in my yaml file: - changeSet: id: 2 author: marios changes: - sqlFile: dbms: sql server, h2 encoding: utf8 endDelimiter: \nGO path: script.sql relativeToChangelogFile: true splitStatements: true stripComments: true What happens here is: changeset number 1 (not shown above) includes create/insert liquibase statements and is being executed on both h2 and sql server changeset 2 only attempts to execute the