class AddDescriptionToEduSettings < ActiveRecord::Migration[5.2]
  def change
    add_column :edu_settings, :description, :string
    add_index :edu_settings, :name, unique: :true

    ['tomcat_webssh', 'webssh_username', 'webssh_password', 'git_address_ip', 'git_address_domain', 'git_username',
    'git_password', 'public_key', 'private_key', 'public_bucket', 'public_bucket_host', 'public_cdn_host', 'cloud_bridge',
    'cloud_tomcat_php', 'host_name', 'old_edu_host'].each do |name|
      if EduSetting.find_by_name(name).nil?
        EduSetting.create(name: name)
      end
    end
  end
end
