1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-02 10:40:07 +00:00
ohmyzsh/plugins/goose/goose.plugin.zsh
Rubem Mota 296c67c9f3
feat(goose): Added aliases for goose migration tool
Signed-off-by: Rubem Mota <rubemmota89@ŋmail.com>
2023-03-22 22:17:53 +00:00

51 lines
874 B
Bash

if (( ! $+commands[goose] )); then
echo "goose not found on Path"
return
fi
#========================#
# FUNCTIONS #
#========================#
function gmcs() {
if [ -z "$1" ]; then
echo "Must specify migration name"
return
fi
goose create $1 sql
}
function gmcg() {
if [ -z "$1" ]; then
echo "Must specify migration name"
return
fi
goose create $1 go
}
function gmut() {
if [ -z "$1" ]; then
echo "Must specify migration version"
return
fi
goose up-to $1
}
function gmdt() {
if [ -z "$1" ]; then
echo "Must specify migration version"
return
fi
goose down-to $1
}
#========================#
# ALIAS #
#========================#
alias gmu="goose up"
alias gmubo="goose up-by-one"
alias gmd="goose down"
alias gmr="goose redo"
alias gms="goose status"
alias gmv="goose version"