Created
June 5, 2009 14:20
-
-
Save duelinmarkers/124302 to your computer and use it in GitHub Desktop.
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
# Allows you to specify the position of a column in your migrations' add_column and change_column calls. | |
ActiveRecord::ConnectionAdapters::MysqlAdapter.class_eval do | |
def add_column_options!(sql, options) | |
super | |
if options[:after] | |
sql << " AFTER #{quote_column_name(options[:after])}" | |
elsif options[:first] | |
sql << " FIRST" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment