method

remove_columns

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveRecord::ConnectionAdapters::SQLite3Adapter
remove_columns(table_name, *column_names, type: nil, **options) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb, line 309
      def remove_columns(table_name, *column_names, type: nil, **options) # :nodoc:
        alter_table(table_name) do |definition|
          column_names.each do |column_name|
            definition.remove_column column_name
          end
          column_names = column_names.map(&:to_s)
          definition.foreign_keys.delete_if { |fk| column_names.include?(fk.column) }
        end
      end
Register or log in to add new notes.