Fix MySQL database creation script
This commit is contained in:
parent
c3ce963858
commit
dc69f3d7f8
|
@ -6,6 +6,6 @@ USE odyfo;
|
|||
|
||||
source databases/production_db.sql;
|
||||
|
||||
USE test;
|
||||
USE test_odyfo;
|
||||
|
||||
source databases/test_db.sql;
|
||||
|
|
10
shell.nix
10
shell.nix
|
@ -5,7 +5,7 @@ with pkgs;
|
|||
let
|
||||
psql_file = "psql_creation.sql";
|
||||
psql_dir = "$(pwd)/.pgdata";
|
||||
mysql_file = "databases/mysql_creation.sql";
|
||||
mysql_file = "mysql_creation.sql";
|
||||
mysql_dir = "$(pwd)/.mysql";
|
||||
socket = "${mysql_dir}/mysql.sock";
|
||||
origin = "mysql:///odyfo";
|
||||
|
@ -34,9 +34,7 @@ in mkShell {
|
|||
pg_ctl start -o "--unix_socket_directories=${psql_dir} --listen_addresses='''"
|
||||
fi
|
||||
|
||||
if [ ! -d ${psql_dir} ]; then
|
||||
psql -d postgres -f ${psql_file}
|
||||
fi
|
||||
psql -d postgres -f ${psql_file}
|
||||
|
||||
# Initialize MySQL
|
||||
if [ ! -d ${mysql_dir} ]; then
|
||||
|
@ -46,9 +44,7 @@ in mkShell {
|
|||
mysqld --datadir="${mysql_dir}" --socket="${socket}" --skip-networking &
|
||||
sleep 5
|
||||
|
||||
if [ ! -d ${mysql_dir} ]; then
|
||||
mysql --socket="${socket}" -u root < ${mysql_file}
|
||||
fi
|
||||
mysql --socket="${socket}" -u root < ${mysql_file}
|
||||
|
||||
alias psql='psql -d postgres'
|
||||
alias mysql='mysql --socket="${socket}" -u root'
|
||||
|
|
Loading…
Reference in New Issue