Skip to content

Commit 7192625

Browse files
committed
Bugfix: mysql argument order matters
1 parent 4273116 commit 7192625

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Just download the stand-alone `gomisql` shell script and make it executable. ;-)
2828
- `-d` Display all executed SQL and back-end output
2929
- `-p <path>` Location of the SQL files [default: `./migrations/`]
3030
- `-b <cmd>` Name of back-end command [default: `mysql`]
31-
- `-a <args>` Arguments to pass to back-end command [default: `--batch`]
31+
- `-a <args>` Additional arguments to pass to back-end command (batch mode is already set)
3232

3333
Several environment variables can also be used, although command line options have priority:
3434

@@ -159,7 +159,7 @@ This is ignored
159159
Running the following would cause migrations foo and bar, then baz to be installed if missing:
160160

161161
```sh
162-
gomisql -y -a "--batch --user dbuser" deploy baz
162+
gomisql -y -a "--user dbuser" deploy baz
163163
```
164164

165165
## FUTURE ENHANCEMENTS

gomisql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3232
# IN THE SOFTWARE.
3333

34-
VERSION="0.3.0"
34+
VERSION="0.3.1"
3535

3636
# Default values
3737
DEBUG=0
3838
MPATH="./migrations/"
39-
BACKEND="mysql --batch"
40-
BACKEND_ARGS=""
39+
BACKEND="mysql"
40+
BACKEND_ARGS="--batch --skip-column-names --disable-pager"
4141

4242
# Environment overrides
4343
if [ -n "$GOMISQL_DEBUG" ]; then DEBUG="$GOMISQL_DEBUG"; fi
@@ -91,7 +91,7 @@ who_needs() {
9191
for MF in $MFS; do
9292
DEPS=$(get_deps "$MF")
9393
if echo "$DEPS" |grep -wq "$1"; then
94-
# FIXME: we rely on our output, so we MUST mute backend() even in DEBUG mode. :-(
94+
# NOTE: we rely on our output, so we MUST mute backend() even in DEBUG mode. :-(
9595
if get_verify "$MF" |backend >/dev/null 2>&1; then
9696
echo "$MF"
9797
fi
@@ -220,8 +220,8 @@ while getopts ":hdp:b:a:" OPT; do
220220
b)
221221
case $OPTARG in
222222
mysql)
223-
BACKEND="mysql --batch --skip-column-names --disable-pager"
224-
;;
223+
BACKEND="mysql"
224+
;;
225225
sqlite|sqlite3)
226226
BACKEND="sqlite3 -bail -batch -noheader"
227227
;;
@@ -235,7 +235,7 @@ while getopts ":hdp:b:a:" OPT; do
235235
esac
236236
;;
237237
a)
238-
BACKEND_ARGS="$OPTARG"
238+
BACKEND_ARGS="$OPTARG $BACKEND_ARGS"
239239
;;
240240
\?)
241241
echo "gomisql: Invalid option '-$OPTARG'"
@@ -313,7 +313,7 @@ Options:
313313
-d Display all executed SQL and back-end output
314314
-p <path> Location of migration SQL files [default: '${MPATH}']
315315
-b <backend> Back-end, one of: mysql (default), sqlite[3], postgresql|pgsql
316-
-a <args> Arguments to pass to back-end command (batch mode is already set)
316+
-a <args> Additional arguments to pass to back-end command (batch mode is already set)
317317
318318
Commands:
319319

0 commit comments

Comments
 (0)