【发布时间】:2023-03-07 23:13:02
【问题描述】:
我正在尝试构建一个迁移,其中包含一个 IP 地址作为一个零填充的无符号整数。
我的迁移目前看起来像这样,但 zerofill: true 不起作用
up do
create table :ip do
Integer :id, size: 7, default: nil
Integer :ip_address_integer, size: 10, unsigned: true, zerofill: true
varchar :scan_time, size: 32
primary_key :id
end
end
如何使用续集 ORM 将 IP 地址填充为零
【问题讨论】: