ximtech / altium-library

Large database component library
18 stars 1 forks source link

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

Open sl33k opened 3 weeks ago

sl33k commented 3 weeks ago

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!