#1154 - Drop functions with length attributes in DB2 #1155
DROP FUNCTION MYFUNC(CHAR); --Fails => old implementation
DROP FUNCTION MYFUNC(DECFLOAT); --Fails
CREATE TABLE CUSTOMER (
CREATE INDEX IDX_CUSTOMER_NAME ON CUSTOMER(LOWER(FIRSTNAME) ASC); --Success (due to special case)
Gives the following error:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:clean (default-cli) on project db2flyway: org.flywaydb.core.api.FlywayException: Unable to clean
flyway:clean is trying to drop the materialized view that is created under the hood by the expression based index:
DROP VIEW IX_CUSTOMER_NAME_V; --Fail
...rather than dropping the index, i.e:
DROP INDEX IX_CUSTOMER_NAME; --Success
If the index name matches "IDX_%_V" it will succeed due to a special exclusion when views are fetched from SYSCAT. Not very robust and not compatible with other naming conventions.
The fix widens the special exclusion to match "%V" rather than "IDX%_V".
…xes), such as CREATE INDEX IX_CUSTOMER_NAME ON CUSTOMER(LOWER(FIRSTNAME) ASC); Before they had to follow a special name convention (start with IDX_) to work correctly.