fordfrog/apgdiff

Fix CommentParser.java

Closed this issue · 1 comments

Need to fix functions parseTrigger and parseConstraint.
parseConstraint:
final String schemaName = ParserUtils.getSchemaName(constraintName, database)
to
final String schemaName = ParserUtils.getSchemaName(tableName, database)

because constraintname doesn't contain schema's name:
COMMENT ON CONSTRAINT "cd_departments_fkey_f_org" ON "registry"."cd_departments" IS 'simple constraint';

Same for parseTrigger:
final String schemaName = ParserUtils.getSchemaName(constraintName, database)
to
final String schemaName = ParserUtils.getSchemaName(tableName, database)
comment example:
COMMENT ON TRIGGER "update_count" ON "registry"."cd_departments" IS 'simple trigger';

I have the same issue. I had to remove the comment and works!.
M.