From fcc06ae4a042fd6af76b8949c73884053823020b Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 8 Feb 2021 09:42:06 +0100 Subject: [PATCH] Fix pgloader database URI --- shell.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shell.nix b/shell.nix index d019c17..b983ce2 100644 --- a/shell.nix +++ b/shell.nix @@ -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 ''; }