chore: Automate conversation display_id generation with db triggers (#1412)
Automate conversation display_id generation with db triggers Co-authored-by: Saurabh Mehta <saurabh1.mehta@airtel.com> Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
@@ -91,4 +91,8 @@ class Account < ApplicationRecord
|
||||
def notify_creation
|
||||
Rails.configuration.dispatcher.dispatch(ACCOUNT_CREATED, Time.zone.now, account: self)
|
||||
end
|
||||
|
||||
trigger.after(:insert).for_each(:row) do
|
||||
"execute format('create sequence IF NOT EXISTS conv_dpid_seq_%s', NEW.id);"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user