Skip to content

Materialized Views don't support schema migrationsΒ #1519

Closed
@malonehedges

Description

@malonehedges

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions