Skip to content

Declarative schema migration generation broken in 2.34.1 #4044

@justsee

Description

@justsee

Describe the bug
The introduction of pg/migra with #3994 breaks supabase diff in our private repository with the error:

Diffing schemas...
error diffing schema: error running container: exit 1:                                                                                            
TypeError: Cannot read properties of undefined (reading 'dependent_on')                                                                           
    at get_related_for_item (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:1076:33)    
    at file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:1077:61                           
    at Array.flatMap (<anonymous>)                                                                                                                
    at get_related_for_item (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:1077:48)    
    at PostgreSQL.load_deps_all (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:1080:25)
    at PostgreSQL.load_all_async (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:974:20)
    at eventLoopTick (ext:core/01_core.js:168:7)                                                                                                  
    at async PostgreSQL.create (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/pg/obj.js:944:9)   
    at async get_inspector (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/schemainspect/0.6.0/dist/get.js:20:23)          
    at async Migration.create (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/@pgkit/migra/0.6.0/dist/migra.js:21:25)             
main worker has been destroyed       

To Reproduce
Unable to share specific migrations which trigger the issue, but command was run with --create-ticket as outlined below.

Expected behavior
supabase diff should complete successfully with no errors, as it does in 2.34.0.

System information

  • Ticket ID: 28480bfe68844f1fbfc746ffec301b41

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions