JHipster Prod 版本构建时 Liquibase date_trunc postgresql 函数错误
Liquibase date_trunc postgresql function error while JHipster Prod version build
我正在尝试在 Liquibase 中为我的 JHipster 应用程序构建 View PostgreSQL table。因此,我尝试了createView and sqlFile种方法。
我的查询具有 date_trunc() 函数,如下所示:
CREATE OR REPLACE VIEW periodical_statistics AS
SELECT tran.id, date_trunc('day', tran.pub_date) as, ...
FROM transaction tran
...(LEFT JOINS - not relative)...
WHERE ...(condtions - not relative)...
当我 运行 我的 JHispster 应用程序在 Maven 中作为 Dev 模式时(./mvnw
)。它工作得很好。
但是当我 运行 它作为 Maven 中的 Prod 模式时(./mvnw -Pprod package
)。它给出以下错误。
20180817101122-1::liquibase-docs failed. Error: Function "DATE_TRUNC" not found;
SQL statement: CREATE OR REPLACE VIEW periodical_statistics AS ....
有什么办法可以解决这个错误问题吗?
将 dbms='postgresql'
添加到变更集之后。 Liquibase 识别了 'date_trunc' 函数。如下:
<changeSet author="sanatbek" id="20180904094713" dbms="postgresql">
<createView replaceIfExists="true"
schemaName="public"
viewName="periodical_statistics">
SELECT
tran.id
date_trunc('day', tran.pub_date) as truncated_date,
....
...(LEFT JOINS - not relative)...
WHERE ...(condtions - not relative)...
</createView>
</changeSet>
我正在尝试在 Liquibase 中为我的 JHipster 应用程序构建 View PostgreSQL table。因此,我尝试了createView and sqlFile种方法。 我的查询具有 date_trunc() 函数,如下所示:
CREATE OR REPLACE VIEW periodical_statistics AS
SELECT tran.id, date_trunc('day', tran.pub_date) as, ...
FROM transaction tran
...(LEFT JOINS - not relative)...
WHERE ...(condtions - not relative)...
当我 运行 我的 JHispster 应用程序在 Maven 中作为 Dev 模式时(./mvnw
)。它工作得很好。
但是当我 运行 它作为 Maven 中的 Prod 模式时(./mvnw -Pprod package
)。它给出以下错误。
20180817101122-1::liquibase-docs failed. Error: Function "DATE_TRUNC" not found;
SQL statement: CREATE OR REPLACE VIEW periodical_statistics AS ....
有什么办法可以解决这个错误问题吗?
将 dbms='postgresql'
添加到变更集之后。 Liquibase 识别了 'date_trunc' 函数。如下:
<changeSet author="sanatbek" id="20180904094713" dbms="postgresql">
<createView replaceIfExists="true"
schemaName="public"
viewName="periodical_statistics">
SELECT
tran.id
date_trunc('day', tran.pub_date) as truncated_date,
....
...(LEFT JOINS - not relative)...
WHERE ...(condtions - not relative)...
</createView>
</changeSet>