package persistence

import (
	"log"

	"github.com/AFASystems/presence/internal/pkg/model"
	"github.com/boltdb/bolt"
)

func CreateBucketIfNotExists(db *bolt.DB) {
	err := db.Update(func(tx *bolt.Tx) error {
		_, err := tx.CreateBucketIfNotExists(model.World)
		return err
	})
	if err != nil {
		log.Fatal(err)
	}
}
