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

Commit

Permalink
fix crash when there is a new view in a new schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslantalpa committed Dec 3, 2020
1 parent b33338f commit 75612ff
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 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.6-subzero"/>
<property name="version" value="2.6.7-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.6-subzero</version>
<version>2.6.7-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
3 changes: 1 addition & 2 deletions src/main/java/cz/startnet/utils/pgdiff/PgDiffViews.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ public static void createViews(final PrintWriter writer,
final PgSchema oldSchema, final PgSchema newSchema,
final SearchPathHelper searchPathHelper) {
for (final PgView newView : newSchema.getViews()) {
final PgView oldView = oldSchema.getView(newView.getName());
if (oldSchema == null
|| !oldSchema.containsView(newView.getName())
|| isViewModified(oldView, newView)) {
|| isViewModified(oldSchema.getView(newView.getName()), newView)) {
searchPathHelper.outputSearchPath(writer);
writer.println();
writer.println(newView.getCreationSQL());
Expand Down

0 comments on commit 75612ff

Please sign in to comment.