Liquibase 在 Postgres 中将列创建为 BIGINT,即使“INT”为 BIGINT。在配置中指定
我有以下 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原来底层数据库是 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.