Skip to content

Commit

Permalink
Added method to build change column definition (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanharan authored Oct 9, 2023
1 parent 137788e commit d1a3b1d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ def remove_index!(table_name, index_name)
execute "DROP INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)}"
end

def build_change_column_definition(table_name, column_name, type, **options) # :nodoc:
td = create_table_definition(table_name)
cd = td.new_column_definition(column_name, type, **options)
ChangeColumnDefinition.new(cd, column_name)
end

def build_change_column_default_definition(table_name, column_name, default_or_changes) # :nodoc:
column = column_for(table_name, column_name)
return unless column
Expand Down

0 comments on commit d1a3b1d

Please sign in to comment.