Fix pgloader database URI

This commit is contained in:
coolneng 2021-02-08 09:42:06 +01:00
parent dc69f3d7f8
commit fcc06ae4a0
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 8 additions and 4 deletions

View File

@ -8,8 +8,10 @@ let
mysql_file = "mysql_creation.sql";
mysql_dir = "$(pwd)/.mysql";
socket = "${mysql_dir}/mysql.sock";
origin = "mysql:///odyfo";
destination = "postgresql:///odyfo";
prod_origin = "mysql://root@unix:${socket}:/odyfo";
prod_destination = "postgresql://localhost/odyfo";
test_origin = "mysql://root@unix:${socket}:/test_odyfo";
test_destination = "postgresql://localhost/test_odyfo";
in mkShell {
buildInputs = [
@ -51,7 +53,9 @@ in mkShell {
alias nuke='rm -rf ${psql_dir} ${mysql_dir}'
alembic upgrade head
pgloader ${origin} ${destination}
pg_dump odyfo > databases/migrated_db.sql
pgloader ${prod_origin} ${prod_destination}
pgloader ${test_origin} ${test_destination}
pg_dump odyfo > databases/psql_prod_db.sql
pg_dump test_odyfo > databases/psql_test_db.sql
'';
}