Add default ordering to issuer_nf_tokens_v2 (#588)

Fixes #589
This commit is contained in:
ledhed2222
2023-04-07 18:15:39 -04:00
committed by GitHub
parent bf65cfabae
commit dfe974d5ab
3 changed files with 8 additions and 3 deletions

View File

@@ -1314,7 +1314,9 @@ CassandraBackend::open(bool readOnly)
<< " taxon bigint,"
<< " token_id blob,"
<< " PRIMARY KEY (issuer, taxon, token_id)"
<< " )";
<< " )"
<< " WITH CLUSTERING ORDER BY (taxon ASC, token_id ASC)"
<< " AND default_time_to_live = " << ttl;
if (!executeSimpleStatement(query.str()))
continue;

View File

@@ -172,7 +172,7 @@ CREATE TABLE clio.issuer_nf_tokens_v2 (
taxon bigint, # The NFT's token taxon
token_id blob, # The NFT's ID
PRIMARY KEY (issuer, taxon, token_id)
)
) WITH CLUSTERING ORDER BY (taxon ASC, token_id ASC) ...
```
This table indexes token IDs against their issuer and issuer/taxon
combination. This is useful for determining all the NFTs a specific account

View File

@@ -221,8 +221,11 @@ public:
token_id blob,
PRIMARY KEY (issuer, taxon, token_id)
)
WITH CLUSTERING ORDER BY (taxon ASC, token_id ASC)
AND default_time_to_live = {}
)",
qualifiedTableName(settingsProvider_.get(), "issuer_nf_tokens_v2")));
qualifiedTableName(settingsProvider_.get(), "issuer_nf_tokens_v2"),
settingsProvider_.get().getTtl()));
statements.emplace_back(fmt::format(
R"(