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

Release/5.0.x #345

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions cardano-db-sync-extended/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Revision history for cardano-db-sync-extended

## 5.0.3

* Workaround fix handling of unsigned 64bit integer fields (#351)

## 5.0.2

* Fix handling of unsigned 64bit integer fields (#334, #335)

## 5.0.1

* Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync-extended/cardano-db-sync-extended.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: >= 1.10
-- http://haskell.org/cabal/users-guide/

name: cardano-db-sync-extended
version: 5.0.1
version: 5.0.3
synopsis: The Extended Cardano DB Sync node
description: A Cardano node that follows the Cardano chain and inserts data from the
chain into a PostgresQL database. It is "extended" because it maintains an
Expand Down
8 changes: 8 additions & 0 deletions cardano-db-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Revision history for cardano-db-sync node

## 5.0.3

* Workaround fix handling of unsigned 64bit integer fields (#351)

## 5.0.2

* Fix handling of unsigned 64bit integer fields (#334, #335)

## 5.0.1

* Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion cardano-db-sync/cardano-db-sync.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: >= 1.10
-- http://haskell.org/cabal/users-guide/

name: cardano-db-sync
version: 5.0.1
version: 5.0.3
synopsis: The Cardano DB Sync node
description: A Cardano node that follows the Cardano chain and inserts data from the
chain into a PostgresQL database.
Expand Down
8 changes: 8 additions & 0 deletions cardano-db/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Revision history for cardano-db

## 5.0.3

* Workaround fix handling of unsigned 64bit integer fields (#351)

## 5.0.2

* Fix handling of unsigned 64bit integer fields (#334, #335)

## 5.0.1

* Update dependencies.
Expand Down
2 changes: 1 addition & 1 deletion cardano-db/cardano-db.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cabal-version: >= 1.10
-- http://haskell.org/cabal/users-guide/

name: cardano-db
version: 5.0.1
version: 5.0.3
synopsis: A base PostgreSQL component for the cardano-db-sync node.
description: Code for the Cardano DB Sync node that is shared between the
cardano-db-node and other components.
Expand Down
7 changes: 6 additions & 1 deletion cardano-db/src/Cardano/Db/Schema/Orphans.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ import Shelley.Spec.Ledger.PParams (ProtVer (..))
instance PersistField DbWord64 where
toPersistValue = PersistText . Text.pack . show . unDbWord64
fromPersistValue (PersistText bs) = Right $ DbWord64 (read $ Text.unpack bs)
fromPersistValue x@(PersistRational r) =
-- If the value is greater than MAX_INT64, it comes back as a PersistRational (wat??).
if denominator r == 1
then Right $ DbWord64 (fromIntegral $ numerator r)
else Left $ mconcat [ "Failed to parse Haskell type DbWord64: ", Text.pack (show x) ]
fromPersistValue x =
Left $ mconcat [ "Failed to parse Haskell type Word64: ", Text.pack (show x) ]
Left $ mconcat [ "Failed to parse Haskell type DbWord64: ", Text.pack (show x) ]

instance PersistField Word128 where
toPersistValue = PersistText . Text.pack . show
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ services:
max-file: "10"

cardano-db-sync:
image: inputoutput/cardano-db-sync:5.0.1
image: inputoutput/cardano-db-sync:5.0.3
environment:
- NETWORK=${NETWORK:-mainnet}
- POSTGRES_HOST=postgres
Expand Down
11 changes: 11 additions & 0 deletions schema/migration-1-0004-20201020.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE FUNCTION migrate() RETURNS void AS $$

BEGIN
EXECUTE 'ALTER DOMAIN lovelace DROP CONSTRAINT IF EXISTS lovelace_check; ';
END;

$$ LANGUAGE plpgsql;

SELECT migrate();

DROP FUNCTION migrate();