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

Clean fails to DROP AGGREGATE in SQL Server #1361

Closed
jcoulehan opened this issue Jul 13, 2016 · 1 comment
Closed

Clean fails to DROP AGGREGATE in SQL Server #1361

jcoulehan opened this issue Jul 13, 2016 · 1 comment

Comments

@jcoulehan
Copy link

@jcoulehan jcoulehan commented Jul 13, 2016

What version of Flyway are you using?

Maven plugin 4.0.3

What database are you using (type & version)?

SQL Server 2014

What operating system are you using?

Windows 7

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)

Created repeatable script to drop and recreate CLR functions. 1 of the functions is an aggregate function.

drop aggregate dbo.HarmonicMeanWithWeight
go

CREATE AGGREGATE [dbo].[HarmonicMeanWithWeight](@value [float], @weight [int])
RETURNS[float]
EXTERNAL NAME [MathUtils].[Intelematics.Data.HarmonicMeanWithWeight]
GO
<<

When running clean the aggregate function does not get dropped. From the error it looks like flyway is calling drop function instead of drop aggregate.

What did you expect to see?

no errors when cleaning the schema.

What did you see instead?

[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:4.0.3:clean (default-cli) on project mwra-test-db: org.flywaydb.core.api.FlywayException: Unable to clean schema [dbo]: Can
not use DROP FUNCTION with 'dbo.HarmonicMeanWithWeight' because 'dbo.HarmonicMeanWithWeight' is a aggregate function. Use DROP AGGREGATE. -> [Help 1]

@axelfontaine axelfontaine added this to the Flyway 4.1 milestone Jul 13, 2016
@axelfontaine axelfontaine added this to the Flyway 5.0 milestone Feb 7, 2017
@axelfontaine axelfontaine removed this from the Flyway 4.1 milestone Feb 7, 2017
@axelfontaine axelfontaine added this to the Flyway 4.2.0 milestone Mar 20, 2017
@axelfontaine axelfontaine removed this from the Flyway 5.0.0 milestone Mar 20, 2017
@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone Apr 27, 2017
@axelfontaine axelfontaine removed this from the Flyway 4.2.0 milestone Apr 27, 2017
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Nov 27, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Nov 27, 2017

This has been fixed as part of the Flyway 5.0.0 work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants