Compare commits

..

1 Commits

Author SHA1 Message Date
coolneng 13336f8c17
Revert "Fix pgloader database URI"
This reverts commit fcc06ae4a0.
2021-02-24 01:50:51 +01:00
1 changed files with 26 additions and 25 deletions

View File

@ -21,37 +21,38 @@ in mkShell {
]; ];
shellHook = '' shellHook = ''
trap "kill 0" EXIT trap "kill 0" EXIT
export PGDATA="${psql_dir}" export PGDATA="${psql_dir}"
export PGHOST="${psql_dir}" export PGHOST="${psql_dir}"
# Initialize PostgreSQL # Initialize PostgreSQL
if [ ! -d ${psql_dir} ]; then if [ ! -d ${psql_dir} ]; then
initdb --auth-local=trust --no-locale --encoding=UTF8 initdb --auth-local=trust --no-locale --encoding=UTF8
fi fi
if ! pg_ctl status; then if ! pg_ctl status; then
pg_ctl start -o "--unix_socket_directories=${psql_dir} --listen_addresses='''" pg_ctl start -o "--unix_socket_directories=${psql_dir} --listen_addresses='''"
fi fi
psql -d postgres -f ${psql_file} psql -d postgres -f ${psql_file}
# Initialize MySQL # Initialize MySQL
if [ ! -d ${mysql_dir} ]; then if [ ! -d ${mysql_dir} ]; then
mysqld --datadir="${mysql_dir}" --socket="${socket}" --initialize-insecure mysqld --datadir="${mysql_dir}" --socket="${socket}" --initialize-insecure
fi fi
mysqld --datadir="${mysql_dir}" --socket="${socket}" --skip-networking & mysqld --datadir="${mysql_dir}" --socket="${socket}" --skip-networking &
sleep 5 sleep 5
mysql --socket="${socket}" -u root < ${mysql_file} mysql --socket="${socket}" -u root < ${mysql_file}
alias psql='psql -d postgres' alias psql='psql -d postgres'
alias mysql='mysql --socket="${socket}" -u root' alias mysql='mysql --socket="${socket}" -u root'
alias nuke='rm -rf ${psql_dir} ${mysql_dir}' alias nuke='rm -rf ${psql_dir} ${mysql_dir}'
alembic upgrade head alembic upgrade head
pgloader ${origin} ${destination} pgloader ${origin} ${destination}
pg_dump odyfo > databases/migrated_db.sql pg_dump odyfo > databases/migrated_db.sql
''; >>>>>>> parent of fcc06ae (Fix pgloader database URI)
'';
} }