chore: Campaign ID migration for existing accounts (#2189)

* chore: Campaign ID migration for existing accounts

* chore: update factory

* chore: minor fixes

* chore: fixes
This commit is contained in:
Sojan Jose
2021-04-30 18:45:24 +05:30
committed by GitHub
parent bd7e9d2790
commit a07200bedf
8 changed files with 42 additions and 15 deletions

View File

@@ -3,9 +3,9 @@
# Table name: campaigns
#
# id :bigint not null, primary key
# content :text not null
# description :text
# enabled :boolean default(TRUE)
# message :text not null
# title :string not null
# trigger_rules :jsonb
# created_at :datetime not null
@@ -28,6 +28,8 @@
class Campaign < ApplicationRecord
validates :account_id, presence: true
validates :inbox_id, presence: true
validates :title, presence: true
validates :message, presence: true
belongs_to :account
belongs_to :inbox
belongs_to :sender, class_name: 'User', optional: true