Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220913043728_create_user_phone_number_validations.rb')
-rw-r--r--db/migrate/20220913043728_create_user_phone_number_validations.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20220913043728_create_user_phone_number_validations.rb b/db/migrate/20220913043728_create_user_phone_number_validations.rb
new file mode 100644
index 00000000000..21a5b4d5519
--- /dev/null
+++ b/db/migrate/20220913043728_create_user_phone_number_validations.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class CreateUserPhoneNumberValidations < Gitlab::Database::Migration[2.0]
+ enable_lock_retries!
+
+ def up
+ create_table :user_phone_number_validations, id: false do |t|
+ t.references :user, primary_key: true, default: nil, type: :bigint, index: false,
+ foreign_key: { on_delete: :cascade }
+
+ t.datetime_with_timezone :validated_at
+ t.timestamps_with_timezone null: false
+
+ t.integer :international_dial_code, null: false, limit: 1
+ t.integer :verification_attempts, null: false, default: 0, limit: 1
+ t.integer :risk_score, null: false, default: 0, limit: 1
+
+ t.text :country, null: false, limit: 3
+ t.text :phone_number, null: false, limit: 12
+ t.text :telesign_reference_xid, limit: 255
+
+ t.index [:international_dial_code, :phone_number], name: :index_user_phone_validations_on_dial_code_phone_number
+ end
+ end
+
+ def down
+ drop_table :user_phone_number_validations
+ end
+end