mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 01:52:31 +01:00
feat(goose): Added aliases for goose migration tool
Signed-off-by: Rubem Mota <rubemmota89@ŋmail.com>
This commit is contained in:
parent
f9f01e48a8
commit
296c67c9f3
2 changed files with 75 additions and 0 deletions
51
plugins/goose/goose.plugin.zsh
Normal file
51
plugins/goose/goose.plugin.zsh
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue