Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

[PostgreSQL] clean should remove views #8

Closed
Tracked by #5
c410-f3r opened this issue Nov 22, 2020 · 4 comments · Fixed by #11
Closed
Tracked by #5

[PostgreSQL] clean should remove views #8

c410-f3r opened this issue Nov 22, 2020 · 4 comments · Fixed by #11
Labels
D-pg Database - PostgreSQL good first issue Good for newcomers

Comments

@c410-f3r
Copy link
Owner

See #5

@c410-f3r c410-f3r added good first issue Good for newcomers D-pg Database - PostgreSQL labels Nov 22, 2020
@c410-f3r c410-f3r mentioned this issue Nov 22, 2020
13 tasks
@zacck-zz
Copy link
Contributor

zacck-zz commented Dec 9, 2020

@c410-f3r Going to try implementing this one, shall we use the flyaway implementation as well?

@c410-f3r
Copy link
Owner Author

c410-f3r commented Dec 9, 2020

@zacck Sure! Feel free to work on this issue.

You can create your own view query selection but yeah, it is probably easier to just look into the flyway implementation. Something like:

SELECT relname AS generic_column FROM pg_catalog.pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace LEFT JOIN pg_depend dep ON dep.objid = c.oid AND dep.deptype = 'e' WHERE c.relkind = 'v' AND  n.nspname = '{schema}' AND dep.objid IS NULL

@zacck-zz
Copy link
Contributor

@c410-f3r I can't seem to understand the SQL operation above would you care to explain it?

@zacck-zz
Copy link
Contributor

Aha I see, this searches for views which we can then drop!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
D-pg Database - PostgreSQL good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants