-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
20 lines (19 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include .env
mgup: # Migrate the DB to the most recent version available
@echo goose migration up
goose -dir ${MIGRATION_DIR} mysql "${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true" up
mgdown: # Roll back the version by 1
@echo goose migration down
goose -dir ${MIGRATION_DIR} mysql "${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true" down
mgreset: # Roll back all migrations
@echo goose migration reset
goose -dir ${MIGRATION_DIR} mysql "${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true" reset
mgredo: # Roll back all migrations
@echo goose migration redo
goose -dir ${MIGRATION_DIR} mysql "${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true" redo
mgstatus: # Dump the migration status for the current DB
@echo goose migration redo
goose -dir ${MIGRATION_DIR} mysql "${DB_USER}:${DB_PASS}@tcp(${DB_HOST}:${DB_PORT})/${DB_NAME}?parseTime=true" status
mgmk: # make migration
@echo goose migration up
goose -dir ${MIGRATION_DIR} create ${m} sql