fix: use go-migrate pkg to init or update db schema

Instead to implement own logic how the database scheme should be updated
or migrated to a newer or older version flucky use now instead the
go-migrate package.
This commit is contained in:
2021-01-30 15:44:21 +01:00
parent 23695b4513
commit 366dccde12
80 changed files with 843 additions and 167 deletions

View File

@ -66,13 +66,25 @@ bin/tmp/${EXECUTABLE}: bindata
# GO-BINDATA
# ==============================================================================
BINDATA_TARGETS := \
pkg/repository/db/bindataSQL.go \
pkg/repository/db/postgres/ddl/bindata.go \
pkg/repository/db/postgres/dml/bindata.go \
pkg/repository/db/sqlite3/ddl/bindata.go \
pkg/repository/db/sqlite3/dml/bindata.go
PHONY+=bindata
bindata: clean ${BINDATA_TARGETS}
pkg/repository/db/bindataSQL.go:
go-bindata -pkg db -o ./pkg/repository/db/bindataSQL.go pkg/repository/db/postgres/*** pkg/repository/db/sqlite3/***
pkg/repository/db/postgres/ddl/bindata.go:
go-bindata -pkg postgresddl -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/postgres/dml/bindata.go:
go-bindata -pkg postgresdml -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/sqlite3/ddl/bindata.go:
go-bindata -pkg sqlite3ddl -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/sqlite3/dml/bindata.go:
go-bindata -pkg sqlite3dml -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
# CLEAN
# ==============================================================================