Rails ActiveRecordMigration manages changes to a database schema. Migrations allows a developer to manage rollout, and rollback, of database schema changes in a controlled and consistent manner.
Sample Script:
class SampleMigration < ActiveRecord::Migration
def self.up
end
def self.down
end
end
Within this migration’s up method, you’d place all of the code necessary to make one logical database change. You’d also capture any change to undo any schema changes. By encapsulating up and down, Rails development and production tools can automate the process of deploying and backing out any change involving persistent object models. These database changes can include:
…
Author: LJ Arthur Neil
No Comments yet...
1
Dec
2007
Categories:
Ruby on Rails