diff --git a/app/models/contact.rb b/app/models/contact.rb index 90f31d71f..af3f605a7 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -7,11 +7,13 @@ # id :integer not null, primary key # additional_attributes :jsonb # contact_type :integer default("visitor") +# country_code :string default("") # custom_attributes :jsonb # email :string # identifier :string # last_activity_at :datetime # last_name :string default("") +# location :string default("") # middle_name :string default("") # name :string default("") # phone_number :string diff --git a/db/migrate/20240129080827_add_location_and_country_code_to_contacts.rb b/db/migrate/20240129080827_add_location_and_country_code_to_contacts.rb new file mode 100644 index 000000000..176624460 --- /dev/null +++ b/db/migrate/20240129080827_add_location_and_country_code_to_contacts.rb @@ -0,0 +1,6 @@ +class AddLocationAndCountryCodeToContacts < ActiveRecord::Migration[7.0] + def change + add_column :contacts, :location, :string, default: '' + add_column :contacts, :country_code, :string, default: '' + end +end diff --git a/db/schema.rb b/db/schema.rb index 83065fb80..a5cff5fb3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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_084032) do +ActiveRecord::Schema[7.0].define(version: 2024_01_29_080827) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "pg_trgm" @@ -421,6 +421,8 @@ ActiveRecord::Schema[7.0].define(version: 2024_01_24_084032) do t.integer "contact_type", default: 0 t.string "middle_name", default: "" t.string "last_name", default: "" + t.string "location", default: "" + t.string "country_code", 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"