instance method
rename_enum
Ruby on Rails 7.2.3
Since v7.1.6Signature
rename_enum(name, options = {})
Rename an existing enum type to something else.
Parameters
-
namereq -
optionsopt = {}
Source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 562
def rename_enum(name, options = {})
to = options.fetch(:to) { raise ArgumentError, ":to is required" }
exec_query("ALTER TYPE #{quote_table_name(name)} RENAME TO #{to}").tap { reload_type_map }
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb line 562
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQLAdapter