Import SQL script only if it's the first run
This commit is contained in:
parent
403f27526d
commit
18a894db97
|
@ -21,7 +21,9 @@ in mkShell {
|
|||
mysqld --datadir="${data_dir}" --socket="${socket}" --skip-networking --skip-mysqlx &
|
||||
sleep 1
|
||||
|
||||
mysql --socket="${socket}" -u root < ${sql_file}
|
||||
if [ ! -d ${data_dir} ]; then
|
||||
mysql --socket="${socket}" -u root < ${sql_file}
|
||||
fi
|
||||
|
||||
alias mysql='mysql --socket="${socket}" -u root'
|
||||
alias nuke='rm -rf ${data_dir}'
|
||||
|
|
|
@ -22,7 +22,10 @@ in mkShell {
|
|||
pg_ctl start -o "--unix_socket_directories=${data_dir} --listen_addresses='''"
|
||||
fi
|
||||
|
||||
psql -d postgres -f ${sql_file}
|
||||
if [ ! -d ${data_dir} ]; then
|
||||
psql -d postgres -f ${sql_file}
|
||||
fi
|
||||
|
||||
alias psql='psql -d postgres'
|
||||
alias nuke='rm -rf ${data_dir}'
|
||||
'';
|
||||
|
|
Loading…
Reference in New Issue