Liquibase 在 Postgres 中将列创建为 BIGINT,即使“INT”为 BIGINT。在配置中指定

发布于 2025-01-19 08:06:18 字数 744 浏览 3 评论 0原文

我有以下 liquibase 脚本片段:

<changeSet author="h311z" id="20220406-1" runInTransaction="false">
        <createTable tableName="states">
            <column name="tx_id" type="varbinary(1024)">
                <constraints nullable="false"/>
            </column>
            <column name="tx_output_id" type="INT">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>

但是在 Postgres 数据库上运行 liquibase 迁移后,该表看起来像这样:

       column_name        | data_type 
--------------------------+-----------
 tx_id              | bytea
 tx_output_id       | bigint

我在这里遗漏了什么吗? 谢谢!

I have the following liquibase script snippet:

<changeSet author="h311z" id="20220406-1" runInTransaction="false">
        <createTable tableName="states">
            <column name="tx_id" type="varbinary(1024)">
                <constraints nullable="false"/>
            </column>
            <column name="tx_output_id" type="INT">
                <constraints nullable="false"/>
            </column>
        </createTable>
    </changeSet>

But after running liquibase migration on a Postgres database, the table looks like this:

       column_name        | data_type 
--------------------------+-----------
 tx_id              | bytea
 tx_output_id       | bigint

Am I missing something here?
Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凤舞天涯 2025-01-26 08:06:18

原来底层数据库是 CockroachDB,它不区分 INT/BIGINT,它们基本上是相同的: https://www.cockroachlabs.com/docs/v20.1/int

我最终使用tinyint代替。

Turns out the underlying database was CockroachDB which does not differentiate INT/BIGINT, they are basically the same: https://www.cockroachlabs.com/docs/v20.1/int

I ended up using tinyint instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文