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

initialScript isn't run against initialDatabases #1673

Open
CalebJohn opened this issue Jan 15, 2025 · 0 comments
Open

initialScript isn't run against initialDatabases #1673

CalebJohn opened this issue Jan 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@CalebJohn
Copy link

Describe the bug
The documentation for Services has an example of running timescaledb that uses initialScript to create the extension. However, initialScript is only run against the default database named postgres, meaning that the timescaledb extensions are not available to the other databases ("mydb" in the Services documentation example).

To reproduce
https://gist.github.com/CalebJohn/6bd1cfc8c4daff6a849ddf7e17d1ecf8

Run devenv up.

It can be seen that the timescaledb extension is not actually loaded for the mydb database (initialDatabases[0]), but it is available under the databased named postgres.

$ psql --dbname mydb --command="SELECT installed_version FROM pg_available_extensions WHERE name = 'timescaledb';"
 installed_version
-------------------

(1 row)


$ psql --dbname postgres --command="SELECT installed_version FROM pg_available_extensions WHERE name = 'timescaledb';"
 installed_version
-------------------
 2.17.2
(1 row)

Version

devenv 1.3.1 (x86_64-linux)

I think this is a matter of the documentation being lacking. There is nothing in the documentation to suggest which database initialScript is being applied against. After digging into the source I think my expected behaviour was wrong, but I wanted to flag up my troubles here as I think I'm not the only one who has run into the same misunderstanding.

@CalebJohn CalebJohn added the bug Something isn't working label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant