Skip to content

Materialized Views don't support schema migrations #1519

Closed

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

Activity

  1. added
    bugSomething isn't working
    triageNew issues that hasn't been reviewed
    on Mar 31, 2022
  2. ludusrusso commented on Apr 4, 2022

    @ludusrusso
    Contributor

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

  3. removed
    triageNew issues that hasn't been reviewed
    on Aug 29, 2022
  4. kyleconroy commented on Oct 24, 2023

    @kyleconroy
    Collaborator

    Fixed in v1.23.0

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

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