On Nov 14, 10:45 am, trung <tr...@phamcom.com> wrote:
> How does datamapper support BigInt?
>
> In ActiveRecord, I can create a migration to add an integer column
> with :limit => 8 flag and it will use mysql BigInt data type.

When you declare your property, use the :min and :max options, eg:

  property :quantity, Integer, :min => 0, :max => 2**32

On MySQL this will create an UNSIGNED BIGINT column on MySQL, and also
setup auto-validations to ensure the quantity is always between the
min and max. You can adjust the max up to 2**64-1 when :min >= 0, and
when min < 0 the max can up to 2**63-1.

--

Dan
(dkubb)

--

You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamap...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=.


Reply via email to