Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(fees): Add unique index on event transaction id #3079

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jdenquin
Copy link
Contributor

  • To prevent duplicate invoicing for in advance charges, we add a unique index based on the transaction_id from the event

@jdenquin jdenquin self-assigned this Jan 20, 2025
@jdenquin jdenquin changed the title Add event transaction id on fees chore(fees): Add unique index on event transaction id Jan 20, 2025

def change
add_index :fees, %i[pay_in_advance_event_transaction_id charge_id charge_filter_id], unique: true,
where: "created_at > '#{Time.current}'", algorithm: :concurrently
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to add pay_in_advance = 't' and pay_in_advance_event_transaction_id is not null as well I guess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants