Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capturing ignored postgres Materialized Views #667

Open
duckboy81 opened this issue Aug 6, 2024 · 0 comments
Open

Capturing ignored postgres Materialized Views #667

duckboy81 opened this issue Aug 6, 2024 · 0 comments

Comments

@duckboy81
Copy link

duckboy81 commented Aug 6, 2024

Issue: Materialized Views are ignored when using --views

Solution: Could either add another option flag --materializedViews OR update the existing showViewsQuery for postgres:

showViewsQuery: (schemaName?: string) => {

Possible inject:

    return `SELECT table_name, table_schema
             FROM information_schema.tables
            WHERE table_type = 'VIEW'
            AND table_schema NOT IN ('pg_catalog', 'information_schema')
              ${makeCondition("table_schema", schemaName)}

            UNION ALL

            SELECT matviewname AS table_name, schemaname AS table_schema
            FROM pg_matviews
            WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
              ${makeCondition("schemaname", schemaName)}`;

EDIT: Nevermind, this fix will not work due to the way sequelize-auto looks for information about the table's construct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant