Use bulk for migration
This commit is contained in:
@@ -67,6 +67,12 @@ Style/OptionHash:
|
||||
Exclude:
|
||||
- lib/redmine_messenger/patches/*.rb
|
||||
|
||||
# postgresql and mysql are supported
|
||||
# autodetect does not work without database configuration
|
||||
Rails/BulkChangeTable:
|
||||
Enabled: true
|
||||
Database: postgresql
|
||||
|
||||
Style/ReturnNil:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
class AddPrivateSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :messenger_settings, :post_private_contacts, :integer, default: 0, null: false
|
||||
add_column :messenger_settings, :post_private_db, :integer, default: 0, null: false
|
||||
change_table :messenger_settings, bulk: true do |t|
|
||||
t.integer :post_private_contacts, default: 0, null: false
|
||||
t.integer :post_private_db, default: 0, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user