feat: Add middle_name and last_name to contact model (#8771)

feat: Add `middle_name` and `last_name`
This commit is contained in:
Muhsin Keloth
2024-01-24 16:22:04 +05:30
committed by GitHub
parent 3760f206e8
commit fa907840c7
3 changed files with 11 additions and 1 deletions

View File

@@ -11,6 +11,8 @@
# email :string
# identifier :string
# last_activity_at :datetime
# last_name :string default("")
# middle_name :string default("")
# name :string default("")
# phone_number :string
# created_at :datetime not null

View File

@@ -0,0 +1,6 @@
class AddMiddleNameAndLastNameToContacts < ActiveRecord::Migration[7.0]
def change
add_column :contacts, :middle_name, :string, default: ''
add_column :contacts, :last_name, :string, default: ''
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2024_01_24_054340) do
ActiveRecord::Schema[7.0].define(version: 2024_01_24_084032) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -419,6 +419,8 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_24_054340) do
t.jsonb "custom_attributes", default: {}
t.datetime "last_activity_at", precision: nil
t.integer "contact_type", default: 0
t.string "middle_name", default: ""
t.string "last_name", default: ""
t.index "lower((email)::text), account_id", name: "index_contacts_on_lower_email_account_id"
t.index ["account_id", "email", "phone_number", "identifier"], name: "index_contacts_on_nonempty_fields", where: "(((email)::text <> ''::text) OR ((phone_number)::text <> ''::text) OR ((identifier)::text <> ''::text))"
t.index ["account_id"], name: "index_contacts_on_account_id"