Sha256: 154a3bc0c4173404b28c86fc8ed2a937ff12a4781f4f30d58696e0e163d60db9

Contents?: true

Size: 828 Bytes

Versions: 28

Compression:

Stored size: 828 Bytes

Contents

class EncryptOrganizationSettings < ActiveRecord::Migration[5.1]
  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

28 entries across 28 versions & 1 rubygems

Version Path
panda_pal-5.1.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.0.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.0.0.beta.4 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.0.0.beta.3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.0.0.beta.2 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-5.0.0.beta.1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.1.0.beta3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.1.0.beta2 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.11 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.10 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.8 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.7 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.6 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.4 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.2 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.1 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-4.0.0 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-3.2.3 db/migrate/20171205183457_encrypt_organization_settings.rb
panda_pal-3.2.2 db/migrate/20171205183457_encrypt_organization_settings.rb