Posts Tagged “migrations”

#check for column
ActiveRecord::Base.connection.tables.include?(name)

#check for table
Model.columns_hash.has_key("column_name")?
DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , ,

Comments 4 Comments »

Migrations as version control for databases

When I first learned about Rails migration, I immediately thought that dropping down a revision would be something you would do often. In actuality, Rails migrations is more like a version control for databases. Since databases changes require modifications to both code and data, you cannot simply use a source code version control system like Subversion or Sourcesafe. You need a more advanced revisioning system for databases… hence Rails Migrations.

Read the rest of this entry »

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , ,

Comments 1 Comment »