-
Notifications
You must be signed in to change notification settings - Fork 39
Add expiry field to gateway envelopes #752
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
Conversation
WalkthroughThe changes introduce support for an Changes
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
🧰 Additional context used🧬 Code Graph Analysis (2)pkg/db/queries/models.go (1)
pkg/db/queries/envelopes.sql.go (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (14)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE gateway_envelopes | |||
| ADD COLUMN expiry BIGINT; No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the generated go code, it seems this will be set to nil to old rows? Just to take it in account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. 0 meens infinite, NULL means it hasn't been set. It requires sophisticated non-sql code to inspect the payload and determine whether it is a commit or not.
Add expiry timestamp field to gateway_envelopes table and update related database operations
Introduces a new
expiryfield of typeBIGINTto thegateway_envelopestable through database migrations and updates related SQL operations. The changes include:expirycolumn togateway_envelopestable via migration files 00011_payload-expiration.up.sql and 00011_payload-expiration.down.sqlexpiryfield in INSERT and SELECT operationsGatewayEnvelopestruct in models.go to includeExpiry sql.NullInt64fieldGetGatewayEnvelopeByIDquery in payerReports.sql.go to include expiry field📍Where to Start
Start with the database migration file 00011_payload-expiration.up.sql which defines the schema change, then review the SQL query templates in envelopes.sql to understand how the new field is used in database operations.
Macroscope summarized adc9cfd.
Summary by CodeRabbit