activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
# Changes the column of a table.
Changes the column of a table.
Changes the column of a table .
def change_column(table_name, column_name, type, options = {})
          clear_cache!
          quoted_table_name = quote_table_name(table_name)
          execute "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}"
          change_column_default(table_name, column_name, options[:default]) if options_include_default?(options)
          change_column_null(table_name, column_name, options[:null], options[:default]) if options.key?(:null)
        end
def change_column ( table_name , column_name , type , options = { } ) clear_cache! quoted_table_name = quote_table_name ( table_name ) execute "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}" change_column_default ( table_name , column_name , options [ :default ] ) if options_include_default? ( options ) change_column_null ( table_name , column_name , options [ :null ] , options [ :default ] ) if options . key? ( :null ) end
Changes the column of a table.
Changes the column of a table .
table_name
column_name
type
options