Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running migration from liquibase CLI fails due to search path not set correctly #156

Open
sl33k opened this issue Aug 22, 2024 · 2 comments

Comments

@sl33k
Copy link

sl33k commented Aug 22, 2024

Hi!

I was trying to import the library manually with liquibase cli, since there is no docker available in my environment.
However it kept failing since the tables were not created under the altium schema by default, and instead in the default public schema.
image

It seems that the migrations/initial-db-scripts/Schema-for-components.sql migrations does not set the default search_path variable correctly. This can be also seen by querying the search_path from psql, which default still to public even after an initial migration run.
image

I've managed to resolve the issue by specificing altium as the search_path during pg_admin database creation,like so
image

Which makes the migration run succesfully, and the database is populated. Maybe this could be fixed in the migrations sql script?

For reference, I'm using Postgres 16.4, and Liquibase 4.29.1 on Windows.
The command used for liquibase is

.\liquibase.bat update --changelog-file=altium-library\migrations\db.changelog-master.xml

and my liquibase.properties file looks like this

url: jdbc:postgresql://localhost:5412/altium-components
username: postgres
password: postgres

Let me know if you need more info.

Cheers!

@ximtech
Copy link
Owner

ximtech commented Sep 20, 2024

Hi. Thank you for such detailed issue description. And yes, there is a such problem indeed, so to solve this you can use altium-migrator. Just fixed this and now before data migration provided schema (or altium by default) will be created (if not exist) and set. So I recommed to use this tool, take a look it takes minimum effort to run it using docker.

@sl33k
Copy link
Author

sl33k commented Sep 20, 2024

Thanks and understood!

I think you should consider fixing it here, since as mentioned many people that might use your tool work in corporate networks which often don’t have access to virtualization tools like docker.

The altium-migrator is quite hard to run without it, while just installing liquibase and a local postgresql installation is possible without even admin rights (which are often also not available in corporate environments)

In any case, thank you for your work in the first place :) this is just some food for thought and maybe a good reference for anyone that has to work in a similarly restricted environment to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants