instance method
lock_options
Ruby on Rails edge
Since edgeSignature
lock_options()
Returns the available lock options for MySQL DDL operations.
MySQL supports the following lock modes:
-
:default- LetMySQLdecide the lock level. -
:none- Allow concurrent reads and writes (online DDL). -
:shared- Allow concurrent reads but block writes. -
:exclusive- Block all concurrent reads and writes.
Source
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 225
def lock_options
{
default: "LOCK = DEFAULT",
none: "LOCK = NONE",
shared: "LOCK = SHARED",
exclusive: "LOCK = EXCLUSIVE",
}
end
Defined in activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb line 225
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter