diff options
Diffstat (limited to 'db/migrate/20210729123101_confirm_security_bot.rb')
-rw-r--r-- | db/migrate/20210729123101_confirm_security_bot.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20210729123101_confirm_security_bot.rb b/db/migrate/20210729123101_confirm_security_bot.rb new file mode 100644 index 00000000000..2184cc4e193 --- /dev/null +++ b/db/migrate/20210729123101_confirm_security_bot.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ConfirmSecurityBot < ActiveRecord::Migration[6.0] + class User < ActiveRecord::Base + self.table_name = 'users' + SECURITY_BOT_TYPE = 8 + end + + def up + User.where(user_type: User::SECURITY_BOT_TYPE, confirmed_at: nil) + .update_all(confirmed_at: Time.current) + end + + # no-op + # Security Bot should be always confirmed + def down + end +end |