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

ingest: asset_types and memo_type columns added #29

Merged
merged 3 commits into from
Jul 1, 2024

Conversation

daniel-burghardt
Copy link
Contributor

What

Adds three columns to the ingest_payments table, to be persisted when running ingestion.
Columns: src_asset_type, dest_asset_type and memo_type.

Why

These are relevant columns to the Vibrant wallet and potentially to other wallets as well.

Known limitations

If ingestion had been running on any instance prior to this merge and there are any records in the ingest_payments table, those must be wiped before the migration can run.
Since the Wallet Backend is in development phase and there are no instances running yet, this shouldn't be a problem.

Issue that this PR addresses

[Wallet Backend] Add new columns to payments ingestion

Checklist

PR Structure

  • It is not possible to break this PR down into smaller PRs.
  • This PR does not mix refactoring changes with feature changes.
  • This PR's title starts with name of package that is most changed in the PR, or all if the changes are broad or impact many packages.

Thoroughness

  • This PR adds tests for the new functionality or fixes.
  • All updated queries have been tested (refer to this check if the data set returned by the updated query is expected to be same as the original one).

Release

  • This is not a breaking change.
  • This is ready to be tested in development.
  • The new functionality is gated with a feature flag if this is not ready for production.

Copy link
Contributor

@CaioTeixeira95 CaioTeixeira95 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@@ -20,7 +20,7 @@ CREATE TABLE ingest_payments (
dest_asset_issuer text NOT NULL,
dest_amount bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
memo text,
memo text NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we've got a deployed version, we should be careful about modifying the migrations.

Copy link
Contributor Author

@daniel-burghardt daniel-burghardt Jul 1, 2024

Choose a reason for hiding this comment

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

For sure! But in this case it should be safe, since this is just making the default value explicit to match the pattern in the other migrations.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's great! 🚀

Comment on lines +4 to +5
ADD COLUMN src_asset_type text NOT NULL,
ADD COLUMN dest_asset_type text NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

We are safe, but if we have entries in this table this migration will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed! I also tried explaining that in the Known limitations section.

DestAmount: 50,
CreatedAt: time.Date(2024, 5, 28, 11, 0, 0, 0, time.UTC),
Memo: &expectedMemo,
Memo: utils.PointOf("memo_test"),
Copy link
Contributor

Choose a reason for hiding this comment

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

🚀

@daniel-burghardt daniel-burghardt merged commit 39df5f3 into main Jul 1, 2024
5 checks passed
@daniel-burghardt daniel-burghardt deleted the ingest-columns-added branch July 1, 2024 14:25
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.

2 participants