fix(pkg/db): create or upgrade postgres schema based on semver
This commit is contained in:
@ -4,17 +4,22 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/semver"
|
||||
"github.com/go-flucky/flucky/pkg/config"
|
||||
"github.com/go-flucky/flucky/pkg/daemon"
|
||||
"github.com/go-flucky/flucky/pkg/logger"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var cleanCacheInterval string
|
||||
var compression bool
|
||||
var configFile *string
|
||||
var round float64
|
||||
var temperatureUnit string
|
||||
var (
|
||||
cleanCacheInterval string
|
||||
compression bool
|
||||
configFile *string
|
||||
round float64
|
||||
temperatureUnit string
|
||||
|
||||
version *semver.Version
|
||||
)
|
||||
|
||||
var daemonCmd = &cobra.Command{
|
||||
Use: "daemon",
|
||||
@ -38,8 +43,10 @@ var daemonCmd = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
func InitCmd(cmd *cobra.Command, cnfFile *string) {
|
||||
func InitCmd(cmd *cobra.Command, cnfFile *string, sverion *semver.Version) {
|
||||
configFile = cnfFile
|
||||
version = sversion
|
||||
|
||||
cmd.AddCommand(daemonCmd)
|
||||
daemonCmd.Flags().BoolVar(&compression, "compression", true, "Compress measured values")
|
||||
daemonCmd.Flags().StringVar(&cleanCacheInterval, "clean-cache-interval", "5m", "Minute intervall to clean cache and write measured values into logfile")
|
||||
|
Reference in New Issue
Block a user