feat: Add APIs for Campaigns (#2175)

This commit is contained in:
Sojan Jose
2021-04-29 22:23:32 +05:30
committed by GitHub
parent 3afc9b5f5b
commit b89cc9cf57
23 changed files with 452 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ class Account < ApplicationRecord
has_many :data_imports, dependent: :destroy
has_many :users, through: :account_users
has_many :inboxes, dependent: :destroy
has_many :campaigns, dependent: :destroy
has_many :conversations, dependent: :destroy
has_many :messages, dependent: :destroy
has_many :contacts, dependent: :destroy
@@ -104,4 +105,8 @@ class Account < ApplicationRecord
trigger.after(:insert).for_each(:row) do
"execute format('create sequence IF NOT EXISTS conv_dpid_seq_%s', NEW.id);"
end
trigger.name('camp_dpid_before_insert').after(:insert).for_each(:row) do
"execute format('create sequence IF NOT EXISTS camp_dpid_seq_%s', NEW.id);"
end
end