Created
May 31, 2011 16:07
-
-
Save etagwerker/1000770 to your computer and use it in GitHub Desktop.
DataMapper.auto_upgrade! Question
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
# Departamento Version 1.0 | |
class Departamento | |
include DataMapper::Resource | |
property :id, Serial | |
property :nombre, String, :index => true | |
end | |
# Then I run rackup with DataMapper.auto_upgrade!, which creates the tables with the structure above. | |
# What if I change something in the structure, eg. | |
# Departamento Version 1.0 | |
class Departamento | |
include DataMapper::Resource | |
property :id, Serial | |
property :nombre, String, :index => true, :required => true | |
end | |
# Then I run rackup again. Will DataMapper.auto_upgrade!, run the proper SQL statements to change the column? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great, this makes sense. It just wasn't clear enough in the getting started page.
I like your idea about inspecting the data and then allowing or not an auto_upgrade!
Thanks!