Search code examples
rubyormsequelpadrino

Set Integer To Zerofill In Sequel Migration (Ruby ORM)


I'm trying to build a migration which would include an IP Address as a zero-filled unsigned integer.

My migration looks something like this currently but zerofill: true is not working

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

How would I make the IP address zero filled using the sequel ORM


Solution

  • Sequel does not support a :zerofill argument for defining columns. You may want to just specify the type directly using something like:

    column :ip_address_integer, 'integer(10) unsigned zerofill'