docbrown/db/migrate/20210201055410_create_users_suspended_usernames.rb
Michael Kohl 0af8fc1866
Prevent suspended users from self-deleting and returning (#12503)
* Add new table and model

* Store banned user username hash on delete

* Prevent previously banned user from signing up again

* Update method name

* Refactor code and add more specs

* Test improvements

* Don't override existing global flash

* Fix typo

* Update spec description

* Update schema.rb

* More schema.rb fixes

* Simplify spec

* Update migration

* Clean up migration

* Rename method

* Add DataDog counter

* Revisit error handling

* Remove spurious empty line

* Make model name more explicit
2021-02-11 09:28:59 +07:00

9 lines
229 B
Ruby

class CreateUsersSuspendedUsernames < ActiveRecord::Migration[6.0]
def change
create_table :users_suspended_usernames, id: false do |t|
t.string :username_hash, primary_key: true
t.timestamps
end
end
end