Create a gist now

Instantly share code, notes, and snippets.

# 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