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

H2: clean does not remove function alias #2335

Closed
SomMeri opened this issue Mar 26, 2019 · 1 comment
Closed

H2: clean does not remove function alias #2335

SomMeri opened this issue Mar 26, 2019 · 1 comment

Comments

@SomMeri
Copy link

@SomMeri SomMeri commented Mar 26, 2019

Which version and edition of Flyway are you using?

2018.5.0 (same issue is with 3.2.1)

If this is not the latest version, can you reproduce the issue with the latest one as well?

(Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Yes. It is the latest version.

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Maven dependency.

Which database are you using (type & version)?

H2 1.4.197 through maven

Which operating system are you using?

Tested with windows and linux.

What did you do?

(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)

1.) I created an alias in migration:

CREATE ALIAS MY_FUNCTION AS $$
Integer diffSeconds(java.util.Date date1, java.util.Date date2) {
	if (date1 == null || date2 == null) {
		return null;
	}
	return (int) (date1.getTime() / 1000 - date2.getTime() / 1000);
}
$$;;

2.) I run the migration flyway.migrate() and then verified that alias exists in database SELECT * FROM INFORMATION_SCHEMA.FUNCTION_ALIASES; statement.

3.) I run clean command: flyway.clean()

What did you expect to see?

The MY_FUNCTION function alias should disappear from database. The SELECT * FROM INFORMATION_SCHEMA.FUNCTION_ALIASES; statement should return no rows.

What did you see instead?

Function alias remained in the database.

@axelfontaine axelfontaine added this to the Flyway 6.0.0 milestone Mar 26, 2019
@axelfontaine axelfontaine changed the title H2: flyway clean does not remove function alias H2: clean does not remove function alias Apr 9, 2019
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Apr 9, 2019
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Apr 9, 2019

Thank you very much for the detailed report and analysis. This was very helpful and the issue has now been fixed.

@axelfontaine axelfontaine removed this from the Flyway 6.0.0 milestone May 22, 2019
@axelfontaine axelfontaine added this to the Flyway 6.0.0-beta2 milestone May 22, 2019
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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants