Class: UpgradePgcryptoTo040
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- UpgradePgcryptoTo040
- Defined in:
- lib/pgcrypto/generators/upgrade/templates/migration.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
19 20 21 |
# File 'lib/pgcrypto/generators/upgrade/templates/migration.rb', line 19 def down raise ActiveRecord::IrreversibleMigration end |
#up ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/pgcrypto/generators/upgrade/templates/migration.rb', line 5 def up # Add columns based on the ones we already know exist PGCrypto::Column.tables_and_columns do |table, column| add_column table, column, :binary end # Migrate column data PGCrypto::ColumnConverter.migrate! # Drop the old, now-unused columns table # COMMENT THIS IN IF YOU REALLY WANT IT # drop_table :pgcrypto_columns end |