Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthandlersux/776883 to your computer and use it in GitHub Desktop.
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)
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