Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
fix exception on view without owner
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslantalpa committed Aug 27, 2019
1 parent bb23559 commit 87fbf59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<project name="apgdiff" default="jar" basedir=".">
<property name="name" value="Another PostgreSQL Diff Tool"/>
<property name="version" value="2.6.3-subzero"/>
<property name="version" value="2.6.4-subzero"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="build.output" value="${build}/classes"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<groupId>cz.startnet</groupId>
<artifactId>apgdiff</artifactId>
<name>Another PostgreSQL Diff Tool</name>
<version>2.6.3-subzero</version>
<version>2.6.4-subzero</version>
<description>Simple PostgreSQL diff tool that is useful for schema upgrades. The tool compares two schema dump files and creates output file that is (after some hand-made modifications) suitable for upgrade of old schema.</description>

<url>http://www.apgdiff.com/</url>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/cz/startnet/utils/pgdiff/PgDiffViews.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ public static void alterViews(final PrintWriter writer,
writer.println(" IS NULL;");
}
}
if (oldView.getOwnerTo() != null && !newView.getOwnerTo().equals(oldView.getOwnerTo())) {
if (
newView.getOwnerTo() != null &&
(
oldView.getOwnerTo() == null ||
!newView.getOwnerTo().equals(oldView.getOwnerTo())
)
) {
writer.println();
writer.println("ALTER VIEW "
+ PgDiffUtils.getQuotedName(newView.getName())
Expand Down

0 comments on commit 87fbf59

Please sign in to comment.