Skip to content

Materialized Views don't support schema migrations #1519

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

Closed
malonehedges opened this issue Mar 31, 2022 · 2 comments · Fixed by #2855
Closed

Materialized Views don't support schema migrations #1519

malonehedges opened this issue Mar 31, 2022 · 2 comments · Fixed by #2855

Comments

@malonehedges
Copy link

malonehedges commented Mar 31, 2022

Version

1.12.0

What happened?

The following migrations result in sqlc believing the materialized view exists in the main public schema, when it has in fact moved

I am running sqlc off the main branch.

-- migration 1:
CREATE MATERIALIZED VIEW something AS
select * from events
where event_type = 'sale'
order by created_at desc;


-- migration 2:
create schema computed_tables;
alter materialized view "something" set schema "computed_tables";


-- query:
-- name: SomeQuery :many
select id from "computed_tables"."something";

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/7475c4ff0c2d81393cd0baa57ede84f0fa0af5bd7ef4885f68450adde9f01b17

What operating system are you using?

macOS

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@malonehedges malonehedges added bug Something isn't working triage New issues that hasn't been reviewed labels Mar 31, 2022
@ludusrusso
Copy link
Contributor

I can work on it if it's ok for @kyleconroy

@kyleconroy
Copy link
Collaborator

Fixed in v1.23.0

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

Successfully merging a pull request may close this issue.

3 participants