diff --git a/modules/runes/constants/constants.go b/modules/runes/constants/constants.go index a17a43f6..acf3fa10 100644 --- a/modules/runes/constants/constants.go +++ b/modules/runes/constants/constants.go @@ -67,7 +67,7 @@ var GenesisRuneConfigMap = map[common.Network]GenesisRuneConfig{ }, Turbo: true, EtchingTxHash: chainhash.Hash{}, - EtchedAt: time.Time{}, + EtchedAt: time.Unix(0, 0), }, common.NetworkFractalMainnet: { RuneId: runes.RuneId{BlockHeight: 1, TxIndex: 0}, @@ -86,7 +86,7 @@ var GenesisRuneConfigMap = map[common.Network]GenesisRuneConfig{ }, Turbo: true, EtchingTxHash: chainhash.Hash{}, - EtchedAt: time.Time{}, + EtchedAt: time.Unix(0, 0), }, common.NetworkFractalTestnet: { RuneId: runes.RuneId{BlockHeight: 1, TxIndex: 0}, @@ -105,7 +105,7 @@ var GenesisRuneConfigMap = map[common.Network]GenesisRuneConfig{ }, Turbo: true, EtchingTxHash: chainhash.Hash{}, - EtchedAt: time.Time{}, + EtchedAt: time.Unix(0, 0), }, } diff --git a/modules/runes/database/postgresql/migrations/000001_initialize_tables.up.sql b/modules/runes/database/postgresql/migrations/000001_initialize_tables.up.sql index a9fbd205..710acd0b 100644 --- a/modules/runes/database/postgresql/migrations/000001_initialize_tables.up.sql +++ b/modules/runes/database/postgresql/migrations/000001_initialize_tables.up.sql @@ -49,7 +49,7 @@ CREATE TABLE IF NOT EXISTS "runes_entries" ( "etched_at" TIMESTAMP NOT NULL ); CREATE UNIQUE INDEX IF NOT EXISTS runes_entries_rune_idx ON "runes_entries" USING BTREE ("rune"); -CREATE UNIQUE INDEX IF NOT EXISTS runes_entries_rune_gin_idx ON "runes_entries" USING GIN ("rune" gin_trgm_ops); -- to speed up queries with LIKE operator +CREATE INDEX IF NOT EXISTS runes_entries_rune_gin_idx ON "runes_entries" USING GIN ("rune" gin_trgm_ops); -- to speed up queries with LIKE operator CREATE UNIQUE INDEX IF NOT EXISTS runes_entries_number_idx ON "runes_entries" USING BTREE ("number"); CREATE TABLE IF NOT EXISTS "runes_entry_states" ( diff --git a/modules/runes/repository/postgres/mapper.go b/modules/runes/repository/postgres/mapper.go index 2b27b69a..5e285111 100644 --- a/modules/runes/repository/postgres/mapper.go +++ b/modules/runes/repository/postgres/mapper.go @@ -221,7 +221,7 @@ func mapRuneEntryTypeToParams(src runes.RuneEntry, blockHeight uint64) (gen.Crea } } } - etchedAt := pgtype.Timestamp{Time: time.Time{}, Valid: true} + etchedAt := pgtype.Timestamp{Time: src.EtchedAt, Valid: true} return gen.CreateRuneEntryParams{ RuneID: runeId,