Feature: Website SDK (#653)

Add SDK functions

Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
Pranav Raj S
2020-04-03 13:04:58 +05:30
committed by GitHub
parent 7fcd2d0e85
commit cb22b396eb
38 changed files with 734 additions and 262 deletions

View File

@@ -0,0 +1,7 @@
class AddIdentifierToContact < ActiveRecord::Migration[6.0]
def change
add_column :contacts, :identifier, :string, index: true, default: nil
add_index :contacts, ['identifier', :account_id], unique: true, name: 'uniq_identifier_per_account_contact'
add_index :contacts, ['email', :account_id], unique: true, name: 'uniq_email_per_account_contact'
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_25_210612) do
ActiveRecord::Schema.define(version: 2020_03_31_095710) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -157,7 +157,10 @@ ActiveRecord::Schema.define(version: 2020_03_25_210612) do
t.datetime "updated_at", null: false
t.string "pubsub_token"
t.jsonb "additional_attributes"
t.string "identifier"
t.index ["account_id"], name: "index_contacts_on_account_id"
t.index ["email", "account_id"], name: "uniq_email_per_account_contact", unique: true
t.index ["identifier", "account_id"], name: "uniq_identifier_per_account_contact", unique: true
t.index ["pubsub_token"], name: "index_contacts_on_pubsub_token", unique: true
end