diff --git a/database/postgresql/postgresql.go b/database/postgresql/postgresql.go index 8fe84e1f..6f4f2797 100644 --- a/database/postgresql/postgresql.go +++ b/database/postgresql/postgresql.go @@ -67,8 +67,8 @@ type Database struct { Logger logging.Logger } -// createPartitionIfNotExists creates a new partition having the given partition id if not existing -func (db *Database) createPartitionIfNotExists(table string, partitionID int64) error { +// CreatePartitionIfNotExists creates a new partition having the given partition id if not existing +func (db *Database) CreatePartitionIfNotExists(table string, partitionID int64) error { partitionTable := fmt.Sprintf("%s_%d", table, partitionID) stmt := fmt.Sprintf( @@ -159,7 +159,7 @@ func (db *Database) SaveTx(tx *types.Tx) error { partitionSize := config.Cfg.Database.PartitionSize if partitionSize > 0 { partitionID = tx.Height / partitionSize - err := db.createPartitionIfNotExists("transaction", partitionID) + err := db.CreatePartitionIfNotExists("transaction", partitionID) if err != nil { return err } @@ -290,7 +290,7 @@ func (db *Database) SaveMessage(msg *types.Message) error { partitionSize := config.Cfg.Database.PartitionSize if partitionSize > 0 { partitionID = msg.Height / partitionSize - err := db.createPartitionIfNotExists("message", partitionID) + err := db.CreatePartitionIfNotExists("message", partitionID) if err != nil { return err }