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

MSSQL Server: exclude microsoft tools procedures/functions from empty schema detection #1095

Closed
JeanRev opened this issue Sep 15, 2015 · 5 comments

Comments

@JeanRev
Copy link
Contributor

JeanRev commented Sep 15, 2015

SQL Server Management Studio automatically creates some procedures and function (eg. sp_alterdiagram, sp_renamediagram, fn_diagramobjects, etc.) for dealing with database diagrams.

Those objects are showing up in the INFORMATION_SCHEMA.ROUTINES view, which in turn will cause the schema to be considered non empty by Flyway. Strictly speaking, they are indeed user-defined objects, but their handling should be (in my opinion) kept outside of the versioning system.

SQL Server Studio will actually list those procedures and functions as "System" objects, relying on the "microsoft_database_tools_support" extended property in addition to the "is_ms_shipped" object field (see: http://stackoverflow.com/questions/1976248/how-do-i-list-all-non-system-stored-procedures ).

I propose to implement the same kind of check in the doEmpty() of the SQLServerSchema class.

@axelfontaine
Copy link
Contributor

Yes, that makes sense. This could also be used for clean by explicitly excluding those.

@axelfontaine
Copy link
Contributor

Would you like to contribute a PR for this?

@JeanRev
Copy link
Contributor Author

JeanRev commented Oct 27, 2015

Yes, I should be able to find some time for this.

@axelfontaine
Copy link
Contributor

Perfect! Looking forward to it!

@axelfontaine
Copy link
Contributor

@JeanRev See my comments on #1272

@axelfontaine axelfontaine added this to the Flyway 4.1.1 milestone Feb 12, 2017
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Feb 13, 2017
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Feb 13, 2017
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants