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