first migration

This commit is contained in:
Barak Michener 2015-06-23 16:39:13 -04:00
parent 983a3a52d0
commit 80ddf74cd2
4 changed files with 68 additions and 7 deletions

View file

@ -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 {