first migration
This commit is contained in:
parent
983a3a52d0
commit
80ddf74cd2
4 changed files with 68 additions and 7 deletions
|
|
@ -89,7 +89,7 @@ func createNewBolt(path string, _ graph.Options) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = qs.setVersion(latestDataVersion)
|
||||
err = setVersion(qs.db, latestDataVersion)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -148,8 +148,8 @@ func (qs *QuadStore) createBuckets() error {
|
|||
})
|
||||
}
|
||||
|
||||
func (qs *QuadStore) setVersion(version int) error {
|
||||
return qs.db.Update(func(tx *bolt.Tx) error {
|
||||
func setVersion(db *bolt.DB, version int64) error {
|
||||
return db.Update(func(tx *bolt.Tx) error {
|
||||
buf := new(bytes.Buffer)
|
||||
err := binary.Write(buf, binary.LittleEndian, version)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue