使用liquibase创建double precision []类型的列 [英] Create column of type double precision[] with liquibase

查看:123
本文介绍了使用liquibase创建double precision []类型的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在postgresql数据库中使用liquibase创建double precision []类型的列(双精度数组)?

How to create column of type double precision[] (array of doubles) with liquibase in postgresql database?

<changeSet id="add t_name table">
    <createTable tableName="t_name">
        ...
        <column name="doubleArray" type="???"/>
        ...
    </createTable>
</changeSet>

Google没有帮助,如果有人知道解决方案,我将非常感激.

Google didn't help, please, if someone knows a solution, I will be very appreciative.

推荐答案

我终于在同事的帮助下找到了答案. 看来liquibase不知道这类类型,因此我们需要手动修改sql查询:

I finally found the answer with help of my colleague. It seems that liquibase don't know such types, so we need to modify sql query manually:

<createTable tableName="t_name">
    ...
    <column name="doubleArray" type="DOUBLE_ARRAY"/>
    ...
</createTable>

<modifySql dbms="postgresql">
    <replace replace="DOUBLE_ARRAY" with="double precision[][]"/>
</modifySql>

这篇关于使用liquibase创建double precision []类型的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆