Module: SaferMigrations::SchemaStatements
- Defined in:
- lib/safer_migrations/schema_statements.rb
Instance Method Summary collapse
- #remove_column(table_name, column_name, type = nil, **options) ⇒ Object (also: #safer_remove_column)
- #remove_columns(table_name, *column_names, type: nil, **options) ⇒ Object (also: #safer_remove_columns)
- #rename_column(table_name, column_name, new_column_name) ⇒ Object (also: #safer_rename_column)
Instance Method Details
#remove_column(table_name, column_name, type = nil, **options) ⇒ Object Also known as: safer_remove_column
6 7 8 9 |
# File 'lib/safer_migrations/schema_statements.rb', line 6 def remove_column(table_name, column_name, type = nil, **) validate_remove_column(table_name, column_name) super end |
#remove_columns(table_name, *column_names, type: nil, **options) ⇒ Object Also known as: safer_remove_columns
11 12 13 14 15 16 |
# File 'lib/safer_migrations/schema_statements.rb', line 11 def remove_columns(table_name, *column_names, type: nil, **) column_names.each do |column_name| validate_remove_column(table_name, column_name) end super end |
#rename_column(table_name, column_name, new_column_name) ⇒ Object Also known as: safer_rename_column
18 19 20 21 |
# File 'lib/safer_migrations/schema_statements.rb', line 18 def rename_column(table_name, column_name, new_column_name) validate_remove_column(table_name, column_name) super end |