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

Commit

Permalink
retain owner on modify view
Browse files Browse the repository at this point in the history
altering views is doe through DROP/CREATE so the owner information needs
to persist even if the view existed in the old schema
  • Loading branch information
ruslantalpa committed Jul 8, 2019
1 parent 0b89ebe commit 4a6db9f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/cz/startnet/utils/pgdiff/PgDiffViews.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void createViews(final PrintWriter writer,
searchPathHelper.outputSearchPath(writer);
writer.println();
writer.println(newView.getCreationSQL());
if (newView.getOwnerTo() != null && oldView == null) {
if (newView.getOwnerTo() != null) {
writer.println();
writer.println("ALTER VIEW "
+ PgDiffUtils.getQuotedName(newView.getName())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ DROP MATERIALIZED VIEW IF EXISTS testview;

CREATE MATERIALIZED VIEW testview AS
SELECT testtable.name, testtable.id FROM testtable;

ALTER VIEW testview OWNER TO fordfrog;
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ DROP VIEW IF EXISTS testview;

CREATE VIEW testview AS
SELECT testtable.name, testtable.id FROM testtable;

ALTER VIEW testview OWNER TO fordfrog;

0 comments on commit 4a6db9f

Please sign in to comment.