Skip to content

Commit

Permalink
CORE-17431 Store data in both BYTEA and JSONB
Browse files Browse the repository at this point in the history
  • Loading branch information
vlajos committed Oct 12, 2023
1 parent de590f2 commit c4f13c3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
<column name="hash" type="VARCHAR(160)">
<constraints nullable="false" primaryKey="true"/>
</column>
<column name="data" type="${json.column.type}">
<column name="canonical_data" type="VARBINARY(1048576)">
<constraints nullable="false"/>
</column>
<column name="json_data" type="${json.column.type}">
<constraints nullable="false"/>
</column>
<column name="group_parameters_hash" type="VARCHAR(160)">
Expand All @@ -150,7 +153,8 @@
INSERT INTO utxo_transaction_metadata
SELECT
hash,
convert_from(data, 'UTF-8')::jsonb AS data,
data as canonical_data,
convert_from(data, 'UTF-8')::jsonb AS json_data,
convert_from(data, 'UTF-8')::jsonb->'membershipGroupParametersHash' AS group_parameters_hash,
convert_from(data, 'UTF-8')::jsonb->'cpiMetadata'->'fileChecksum' AS cpi_file_checksum
FROM
Expand Down

0 comments on commit c4f13c3

Please sign in to comment.