diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2021-04-17 03:14:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 03:14:25 +0200 |
commit | b3ceb3dcc4df62803aa967d7aecee686973a8996 (patch) | |
tree | dc34486813237852b90cc81b26c4e361323c7757 /db/migrate | |
parent | 170e05db127c9f357183239a5543bdfc9525680d (diff) |
Add canonical e-mail blocks for suspended accounts (#16049)
Prevent new accounts from being created using the same underlying e-mail as a suspended account using extensions and period permutations. Stores e-mails as a SHA256 hash
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20210416200740_create_canonical_email_blocks.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20210416200740_create_canonical_email_blocks.rb b/db/migrate/20210416200740_create_canonical_email_blocks.rb new file mode 100644 index 000000000..a1f1660bf --- /dev/null +++ b/db/migrate/20210416200740_create_canonical_email_blocks.rb @@ -0,0 +1,10 @@ +class CreateCanonicalEmailBlocks < ActiveRecord::Migration[6.1] + def change + create_table :canonical_email_blocks do |t| + t.string :canonical_email_hash, null: false, default: '', index: { unique: true } + t.belongs_to :reference_account, null: false, foreign_key: { on_cascade: :delete, to_table: 'accounts' } + + t.timestamps + end + end +end |