fixed #70 + made db script ignore double bookings
Some checks failed
Tests / Run Go Tests (push) Failing after 2m0s

This commit is contained in:
2026-01-17 22:25:25 +01:00
parent 1daf4db167
commit cfd77ae28d
6 changed files with 105 additions and 32 deletions

View File

@@ -25,13 +25,14 @@ func OpenDatabase() (models.IDatabase, error) {
}
func Migrate() error {
return nil
dbHost := helper.GetEnv("POSTGRES_HOST", "localhost")
dbName := helper.GetEnv("POSTGRES_DB", "arbeitszeitmessung")
// dbUser := helper.GetEnv("POSTGRES_USER", "api_nutzer")
dbPassword := helper.GetEnv("POSTGRES_PASSWORD", "password")
dbTz := helper.GetEnv("TZ", "Europe/Berlin")
migrations := helper.GetEnv("MIGRATIONS_DIR", "../migrations")
migrations := helper.GetEnv("MIGRATIONS_PATH", "../migrations")
connStr := fmt.Sprintf("postgres://%s:%s@%s:5432/%s?sslmode=disable&TimeZone=%s", "migrate", dbPassword, dbHost, dbName, dbTz)
m, err := migrate.New(fmt.Sprintf("file://%s", migrations), connStr)