Add Support for Advance Labels ( LabelV2)

Add Support for Custom Migration to keep supporting two database( sqlite and postgres)
Migration from Label to LabelV2
This commit is contained in:
Mo Tarbin 2024-11-23 20:29:53 -05:00
parent 6dc8092ff4
commit 0c07b33359
12 changed files with 730 additions and 49 deletions

View file

@ -33,13 +33,11 @@ func NewDatabase(cfg *config.Config) (*gorm.DB, error) {
}
default:
path := os.Getenv("DT_SQLITE_PATH")
if path == "" {
db, err = gorm.Open(sqlite.Open("donetick.db"), &gorm.Config{})
} else {
db, err = gorm.Open(sqlite.Open(path), &gorm.Config{})
path = "donetick.db"
}
db, err = gorm.Open(sqlite.Open(path), &gorm.Config{})
}