#1497 ✓not-applicable
Foo Bar

Incorrect String property :default behavior

Reported by Foo Bar | March 21st, 2011 @ 09:45 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 :error, String, :length => 140, :default => :null 
    
end

DataMapper.auto_upgrade!

gives out:

CREATE TABLE IF NOT EXISTS `tests` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `error` varchar(140) DEFAULT 'null',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Why default 'null' ? not 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 »

Pages