Skip to content

Instantly share code, notes, and snippets.

@zhhz
Created March 19, 2009 15:03
Show Gist options
  • Select an option

  • Save zhhz/81857 to your computer and use it in GitHub Desktop.

Select an option

Save zhhz/81857 to your computer and use it in GitHub Desktop.
class Employee
include DataMapper::Resource
property :id, Serial
property :name, String
...
end
class Manager < Employee
property :position, String, :default => 'manager'
...
end
Manager.auto_migrate!
the table will have following columns:
id
name
Manger.auto_upgrade!
the table will have following columns:
id
name
position
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment