Permalink
Browse files

pull add_column_options! off the pg connection class

  • Loading branch information...
1 parent 6b7fdf3 commit 072dbbf2aeb2be4f074ba8e404ee157f281bedf9 @tenderlove tenderlove committed Mar 16, 2013
@@ -15,6 +15,19 @@ def visit_AlterTable(o)
sql
end
+
+ def add_column_options!(sql, options)
+ if options[:array] || options[:column].try(:array)
+ sql << '[]'
+ end
+
+ column = options.fetch(:column) { return super }
+ if column.type == :uuid && options[:default] =~ /\(\)/
+ sql << " DEFAULT #{options[:default]}"
+ else
+ super
+ end
+ end
end
def schema_creation
@@ -627,19 +627,6 @@ def table_alias_length
@table_alias_length ||= query('SHOW max_identifier_length', 'SCHEMA')[0][0].to_i
end
- def add_column_options!(sql, options)
- if options[:array] || options[:column].try(:array)
- sql << '[]'
- end
-
- column = options.fetch(:column) { return super }
- if column.type == :uuid && options[:default] =~ /\(\)/
- sql << " DEFAULT #{options[:default]}"
- else
- super
- end
- end
-
# Set the authorized user for this session
def session_auth=(user)
clear_cache!

0 comments on commit 072dbbf

Please sign in to comment.