#1496 ✓not-applicable
Foo Bar

Incorrect Enum type representation

Reported by Foo Bar | March 21st, 2011 @ 09:42 AM

require 'rubygems'

require 'dm-core'
require 'dm-types'
require 'dm-validations'
require 'dm-timestamps'
require 'dm-migrations'

DataMapper.setup(:default, "mysql://")

class Test

    include DataMapper::Resource
    
    property :id, Serial
    property :result, Enum[ :ok, :not_ok ], :default => 0 
    
end

DataMapper.auto_upgrade!

gives out:

CREATE TABLE IF NOT EXISTS `tests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `result` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

why signed int(11) and default NULL ?

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Pages