-
Notifications
You must be signed in to change notification settings - Fork 166
LG-11208: disposable email database #9440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fed2fbb
7d7076d
ad30741
d285f1d
97a79f2
04eaf69
84c0503
5b4e733
3c9baed
9ca06e7
63356ca
636b332
3dafaef
0134d1b
a3ad00e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| class DisposableDomain < ApplicationRecord | ||
| end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| class CreateEmailDataTable < ActiveRecord::Migration[7.0] | ||
| def change | ||
| enable_extension "citext" | ||
|
|
||
| create_table :disposable_domains do |t| | ||
| t.citext :name, null: false | ||
| end | ||
|
|
||
| add_index :disposable_domains, :name, unique: true | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -10,8 +10,9 @@ | |||||
| # | ||||||
| # It's strongly recommended that you check this file into your version control system. | ||||||
|
|
||||||
| ActiveRecord::Schema[7.1].define(version: 2023_08_31_124437) do | ||||||
| ActiveRecord::Schema[7.1].define(version: 2023_10_24_172229) do | ||||||
| # These are extensions that must be enabled in order to support this database | ||||||
| enable_extension "citext" | ||||||
| enable_extension "pg_stat_statements" | ||||||
| enable_extension "pgcrypto" | ||||||
| enable_extension "plpgsql" | ||||||
|
|
@@ -94,6 +95,11 @@ | |||||
| t.index ["user_id", "last_used_at"], name: "index_device_user_id_last_used_at" | ||||||
| end | ||||||
|
|
||||||
| create_table "disposable_domains", force: :cascade do |t| | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't occur to me until now, but it would be nice to incorporate the word "email" in this name. The domains themselves aren't disposable, it's the fact that the domains offer a disposable email service.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we don't want to deal with a table rename, we could rename the active record model and set the table name to what it is now (like we do with the |
||||||
| t.citext "name", null: false | ||||||
| t.index ["name"], name: "index_disposable_domains_on_name", unique: true | ||||||
| end | ||||||
|
|
||||||
| create_table "doc_auth_logs", force: :cascade do |t| | ||||||
| t.integer "user_id", null: false | ||||||
| t.datetime "welcome_view_at", precision: nil | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # rubocop:disable Rails/SkipsModelValidations | ||
| require 'csv' | ||
| namespace :disposable_domains do | ||
| task :load, %i[s3_url] => [:environment] do |_task, args| | ||
| file = Identity::Hostdata.secrets_s3.read_file(args[:s3_url]) | ||
| names = file.split("\n") | ||
| DisposableDomain.insert_all(names.map { |name| { name: } }) | ||
| end | ||
| end | ||
| # rake "disposable_domains:load['URL_HERE']" | ||
| # rubocop:enable Rails/SkipsModelValidations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I correct in assuming we won't need anything additional to be installed in deployed environments for this to be enabled?