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

Add is_active column to nft_metadata table #97

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

tifrel
Copy link
Member

@tifrel tifrel commented Mar 4, 2024

This PR

  • Adds a is_active column to nft_metadata

Checklist:

  • does a DB schema change
    • hasura permissions are updated
    • the indexer is halted
    • the corresponding minterop-producer PR is ready
    • the corresponding minterop-consumer PR is ready
  • changes pubsub payloads
    • the indexer is halted
    • the corresponding minterop-producer PR is ready
    • the corresponding minterop-consumer PR is ready
  • deprecates hasura permissions
    • frontend won't break
  • creates hasura triggers/actions/events etc.
    • postgres DB user has been granted appropriate permissions

Copy link

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

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

This PR does exactly what it says it does. I am just left wondering what is the intended purpose of adding it. Do we have some list of inactive tokens we would set to false immediately after this lands?

@tifrel
Copy link
Member Author

tifrel commented Mar 7, 2024

This PR does exactly what it says it does. I am just left wondering what is the intended purpose of adding it. Do we have some list of inactive tokens we would set to false immediately after this lands?

Nope, we are deactivating old metadata on metadata updates for dynamic NFTs, such that we can query active metadata by their mb_internal_id = {ID} and is_active = true. Now there is an edge case of an update mechanism where we would set metadata to be inactive while it's actually still in use, and the only way to figure out is to join token count. If there are no more unburned tokens associated with a metadata, it is inactive, and I have implemented that logic when updating the field.

@tifrel tifrel marked this pull request as ready for review March 7, 2024 12:38
Copy link

@bh2smith bh2smith left a comment

Choose a reason for hiding this comment

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

Easy peasy!

@tifrel tifrel merged commit 5121162 into main Mar 11, 2024
1 check failed
@tifrel tifrel deleted the metadata-add-is-active-column branch March 11, 2024 11:42
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