OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/db/migrate/20190227163226_add_tls_mode...

20 lines
562 B

class AddTlsModeToAuthSources < ActiveRecord::Migration[5.2]
def change
add_column :auth_sources, :tls_mode, :integer, default: 0, null: false
LdapAuthSource.reset_column_information
reversible do |dir|
dir.up do
LdapAuthSource.where(tls: true).update_all(tls_mode: 1)
end
dir.down do
LdapAuthSource.where(tls_mode: 0).update_all(tls: false)
LdapAuthSource.where(tls_mode: 1).update_all(tls: true)
end
end
remove_column :auth_sources, :tls, :boolean, default: false, null: false
end
end