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

Issue during install several scripts #165

Open
erikpassadore opened this issue Oct 10, 2024 · 3 comments
Open

Issue during install several scripts #165

erikpassadore opened this issue Oct 10, 2024 · 3 comments

Comments

@erikpassadore
Copy link

Hi,
I'm using this tool to automatically update the structure of my database during the deployment process.
I have a folder with all scripts from version 000001.sql to version 000020.sql

Before creating of the last script (000020.sql) I didn't have any problems, but now the tool doesn't update the database.
For example: I have to update a DB where scripts number 11,12,13 and 20 are missing.
The result of the Install-DBOScript command is the following, but the database is not updated.

image

Do you have any idea what the problem might be?

@nvarscar
Copy link
Collaborator

Could you run this with a -Debug switch and see if there's extra output that could be useful? The only reason for this behaviour I can think of is that one of the scripts has a statement that changes the DB context (like USE in SQL Server); in such scenario the journal in the current database won't register your changes.

@erikpassadore
Copy link
Author

I tried to run the command with the -Debug parameter and that is the result:

image

But, I found that the problem is related to the script 000011.sql because this script start a transaction, make some changes to the DB and (for unknow reason) the transaction still pending. Removing this transaction all scripts are executed fine.
The quesiton is, why DBOPS return the "Upgrade successful" also if I have this issue?

Thank's a lot for your help.

@nvarscar
Copy link
Collaborator

The quick answer here is that the underlying framework (DbUp) is reporting the deployment as successful, but I guess what really happens is that once the connection is terminated, the transaction is rolled back. I'll have to play with it to see if it's even possible to detect, if that's the case.

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