From e8beccdaa4eb36fd292de9cd77d59a0e0389c92f Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 19 Dec 2019 11:21:49 +0000 Subject: [PATCH] DEV: Drop unused api_keys.key column This completes the migration to hashed API keys which was started in 4c9ca24ccfc7485c86ac2afe58f5a883d27af446 --- .../20191219112000_remove_key_from_api_keys.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 db/post_migrate/20191219112000_remove_key_from_api_keys.rb diff --git a/db/post_migrate/20191219112000_remove_key_from_api_keys.rb b/db/post_migrate/20191219112000_remove_key_from_api_keys.rb new file mode 100644 index 00000000000..75e93d3c950 --- /dev/null +++ b/db/post_migrate/20191219112000_remove_key_from_api_keys.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +class RemoveKeyFromApiKeys < ActiveRecord::Migration[6.0] + DROPPED_COLUMNS ||= { + api_keys: %i{key} + } + + def up + DROPPED_COLUMNS.each do |table, columns| + Migration::ColumnDropper.execute_drop(table, columns) + end + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end