1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-12-02 18:50:09 +00:00
ohmyzsh/plugins/goose/goose.plugin.zsh

52 lines
874 B
Bash
Raw Normal View History

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"