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

Cannot script/create database containing user assigned to role #188

Closed
AndyIII opened this issue Nov 16, 2020 · 1 comment
Closed

Cannot script/create database containing user assigned to role #188

AndyIII opened this issue Nov 16, 2020 · 1 comment
Assignees
Labels

Comments

@AndyIII
Copy link

AndyIII commented Nov 16, 2020

I have a database that I was Scripting and Creating with version 1.3.56 successfully. Version 1.4 will not Create from the scripts, nor will it Create from the scripts it makes using version 1.4 to do a Script operation.

I have this small example that Creates successfully in 1.3.56 and not with version 1.4. Trying to Script the database with version 1.4 yields minor differences in the usr.sql file (brackets) and one additional file in the permissions folder that is a duplicate of a line in MyRole.sql. Trying to Create from those scripts doesn't work either. The error message is:

An unexpected SQL error occurred while executing scripts, and the process wasn't completed.
.\scripts\users\usr.sql (Line 71):
The role 'MyRole' does not exist in the current database.

Also, please note that usr.sql only has 6 lines or so, not 71.
scripts.zip

@sethreno sethreno added the bug label Dec 21, 2021
@sethreno sethreno self-assigned this Dec 21, 2021
@sethreno
Copy link
Owner

sethreno commented Dec 21, 2021

Thanks for reporting. I found this regressed in commit 1fbd8f5

sethreno added a commit that referenced this issue Dec 22, 2021
This was only used in tests and has different behavior with respect to
resolving dependencies between db objects than ScriptToDir / CreateFromDir.

I'm removing it to make sure tests use CreateFromDir and verify the path
acutally used by the cli.

This is in preperation to fix the issue with users assigned to role #188

Also added two failings test for the user / role bug.
sethreno added a commit that referenced this issue Dec 24, 2021
Refs #188

This is still a work in progress though as it causes a regression for
the case when a user is assigned to a schema.

Also starated to migrating logging to use
Microsoft.Extensions.Logging.Abstractions. That's also a work in progress and
likely broke console logging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants