Feature: Twilio SMS Channel (#658)

Twilio SMS Channel
Fixes :  #350
This commit is contained in:
Pranav Raj S
2020-04-05 22:11:27 +05:30
committed by GitHub
parent 8e59564793
commit a1a81e3799
44 changed files with 918 additions and 33 deletions

View File

@@ -0,0 +1,11 @@
class CreateChannelTwilioSms < ActiveRecord::Migration[6.0]
def change
create_table :channel_twilio_sms do |t|
t.string :phone_number, null: false
t.string :auth_token, null: false
t.string :account_sid, null: false
t.integer :account_id, null: false
t.timestamps
end
end
end

View File

@@ -0,0 +1,7 @@
class AddUniqueValidationIndex < ActiveRecord::Migration[6.0]
def change
add_index :channel_twitter_profiles, [:account_id, :profile_id], unique: true
add_index :channel_twilio_sms, [:account_id, :phone_number], unique: true
add_index :webhooks, [:account_id, :url], unique: true
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_31_095710) do
ActiveRecord::Schema.define(version: 2020_04_04_135009) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -115,6 +115,16 @@ ActiveRecord::Schema.define(version: 2020_03_31_095710) do
t.index ["page_id"], name: "index_channel_facebook_pages_on_page_id"
end
create_table "channel_twilio_sms", force: :cascade do |t|
t.string "phone_number", null: false
t.string "auth_token", null: false
t.string "account_sid", null: false
t.integer "account_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["account_id", "phone_number"], name: "index_channel_twilio_sms_on_account_id_and_phone_number", unique: true
end
create_table "channel_twitter_profiles", force: :cascade do |t|
t.string "name"
t.string "profile_id", null: false
@@ -123,6 +133,7 @@ ActiveRecord::Schema.define(version: 2020_03_31_095710) do
t.integer "account_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["account_id", "profile_id"], name: "index_channel_twitter_profiles_on_account_id_and_profile_id", unique: true
end
create_table "channel_web_widgets", id: :serial, force: :cascade do |t|
@@ -331,6 +342,7 @@ ActiveRecord::Schema.define(version: 2020_03_31_095710) do
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.integer "webhook_type", default: 0
t.index ["account_id", "url"], name: "index_webhooks_on_account_id_and_url", unique: true
end
add_foreign_key "account_users", "accounts"