Sha256: 0e296211c4ed8e55225554b14486c21d2b3f398fdf732ee37131e80d32f2c71a

Contents?: true

Size: 836 Bytes

Versions: 83

Compression:

Stored size: 836 Bytes

Contents

class EncryptOrganizationSettings < PandaPal::MiscHelper::MigrationClass
  def up
    # don't rerun this if it was already run before we renamed the migration.
    existing_versions = execute ("SELECT * from schema_migrations where version = '30171205183457'")
    if (existing_versions.count > 0)
      execute "DELETE from schema_migrations where version = '30171205183457'"
      return
    end
    rename_column :panda_pal_organizations, :settings, :old_settings
    add_column :panda_pal_organizations, :encrypted_settings, :text
    add_column :panda_pal_organizations, :encrypted_settings_iv, :string
  end

  def down
    rename_column :panda_pal_organizations, :old_settings, :settings
    remove_column :panda_pal_organizations, :encrypted_settings
    remove_column :panda_pal_organizations, :encrypted_settings_iv
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
panda_pal-5.12.7 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.6 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.5 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.4 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.2 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.12.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.11.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.10.1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.10.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.8.beta1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.7 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.6 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.5 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.4 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.9.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.8.5 db/migrate/20171205183457_encrypt_organization_settings.rb