postgresql - Why my liquibase modifySQL clause is not triggered? -
i'm trying define dbms schema liquibase (in spring-boot project). relevant part of project json storage i'm trying setup.
even know relational dbms not able process json correctly or starting (as may 2016), want have kind of vendor agnostic schema. so, set blob (or else, advise appreciate) default datatype rdbms, , specialized able deal : famous jsonb postgresql, or least json h2 , mysql.
as use spring-boot, don't have config (indeed none ;))
it seems modifysql clause not triggerred. i'm using following changeset.
yaml liquibase changeset
databasechangelog: - changeset: id: 1 author: jrevy changes: - createtable: tablename: recipe columns: - column: name: id type: uuid constraints: primarykey: true nullable: false - column: name: name type: varchar(255) constraints: nullable: false - column: name: data type: blob constraints: nullable: false modifysql: - replace: dbms: postgresql replace: blob with: jsonb - replace: dbms: h2,mysql replace: blob with: json
result
info 24/05/16 14:56: liquibase: acquired change log lock info 24/05/16 14:56: liquibase: creating database history table name: public.databasechangelog info 24/05/16 14:56: liquibase: reading public.databasechangelog info 24/05/16 14:56: liquibase: classpath:/db/changelog/db.changelog-master.yaml: classpath:/db/changelog/db.changelog-master.yaml::1::jrevy: table recipe created info 24/05/16 14:56: liquibase: classpath:/db/changelog/db.changelog-master.yaml: classpath:/db/changelog/db.changelog-master.yaml::1::jrevy: changeset classpath:/db/changelog/db.changelog-master.yaml::1::jrevy ran in 46ms info 24/05/16 14:56: liquibase: released change log lock [...] info 67628 --- [ main] org.hibernate.version : hhh000412: hibernate core {4.3.11.final} 2016-05-24 14:56:33.765 info 67628 --- [ main] org.hibernate.cfg.environment : hhh000206: hibernate.properties not found 2016-05-24 14:56:33.765 info 67628 --- [ main] org.hibernate.cfg.environment : hhh000021: bytecode provider name : javassist 2016-05-24 14:56:34.030 info 67628 --- [ main] o.hibernate.annotations.common.version : hcann000001: hibernate commons annotations {4.0.5.final} 2016-05-24 14:56:34.280 info 67628 --- [ main] org.hibernate.dialect.dialect : hhh000400: using dialect: org.hibernate.dialect.postgresql9dialect
-->
-- column: data -- alter table recipe drop column data; alter table recipe add column data bytea; alter table recipe alter column data set not null;
datatype should jsonb, not bytea (it works quite if use jsbon default data type, pgsql).
question
- how can know if modifysql clause detected / triggered ?
- do know why it's not working expected ?
remove - before replace (https://github.com/liquibase/liquibase/blob/e0badd697d82a87ba868b41e68b659cf8c8e68e8/liquibase-integration-tests/src/test/resources/changelogs/yaml/rollback.tests.changelog.yaml) ?
try modifysql without dbms see if triggered. , test liquibase cmd line exclude spring-boot bug.
Comments
Post a Comment