-
Notifications
You must be signed in to change notification settings - Fork 8
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
Need an API to Ensure schema exists in postgressql #7
Comments
I'm a bit confused, @hari2m. Wouldn't ensuring the schema exists simply be part of the SQL scripts that DbUp executes on an empty database? That's how I've always used DbUp. |
My scripts does ensure the schema. But the problem is when the dbup tries to create the schemahistory table. I asked it to create the table within the schema and by then my scripts are not executed. So the process errors due to missing schema. |
Hello, for me when I use a different schema, I add the create schema as part of the 0001.sql file. If you check the file src\dbup-postgresql\PostgresqlExtensions.cs, on the method ` sqlCommandText = string.Format
If you want to create the schema if not exist. You should not use JournalToPostgresqlTable, you can use the PerformUpgrade like this:
|
Note: Write documentation how to use dbup with auto creation of schema |
When working with Postgresql. I am using docker instance as I develop locally to spin up and test my code, in this case I am using ensure database so that it creates the database when I spin up new docker container. But the code fails as the schema does not exist and I have to create a schema manually. It would help if we have a ensure schema API.
The text was updated successfully, but these errors were encountered: