Created
January 12, 2011 21:08
-
-
Save matthandlersux/776883 to your computer and use it in GitHub Desktop.
you'll notice that on the call to the second DataMapper.auto_upgrade! there is no "ALTER TABLE" issued to extend the length of the field to varchar(255)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'dm-core' | |
require 'dm-migrations' | |
DataMapper::Logger.new($stdout, :debug) | |
DataMapper.setup(:default, 'sqlite:./test.db') | |
class Post | |
include DataMapper::Resource | |
property :id, Serial | |
property :test, String | |
end | |
DataMapper.finalize | |
DataMapper.auto_upgrade! | |
puts "------------------------------------------------------------------" | |
class Post | |
property :test, String, :length => 1..255 | |
end | |
DataMapper.auto_upgrade! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment