Skip to content

Migration issue with supabase db diff for partition tables #2970

Open
@HimaniShah1

Description

@HimaniShah1

Describe the bug
supabase db diff command gives an error when creating a migration on db that contains partition table. A new partition table is generated every month and for incremental migrations, it is creating an issue.

To Reproduce
Steps to reproduce the behavior:

  1. Create a db with partition table
  2. dump it and create the first migration
  3. create another table in that partition table
  4. run supabase db diff (to create a new migration)

Expected behavior
A new migration file with the updated changes should be created.

System information

  • Version of CLI: Tried with both v1.226.4 and v2.0.0
  • Version of Docker: v27.3.1

Error Log
error diffing schema: error running container: exit 1:
Traceback (most recent call last):
File "/usr/local/bin/migra", line 8, in
sys.exit(do_command())
File "/usr/local/lib/python3.9/site-packages/migra/command.py", line 121, in do_command
status = run(args)
File "/usr/local/lib/python3.9/site-packages/migra/command.py", line 98, in run
m.add_all_changes(privileges=args.with_privileges)
File "/usr/local/lib/python3.9/site-packages/migra/migra.py", line 107, in add_all_changes
self.add(self.changes.tables_only_selectables())
File "/usr/local/lib/python3.9/site-packages/migra/changes.py", line 496, in get_selectable_changes
statements += get_table_changes(
File "/usr/local/lib/python3.9/site-packages/migra/changes.py", line 233, in get_table_changes
rls_alter = v.alter_rls_statement
File "/usr/local/lib/python3.9/site-packages/schemainspect/pg/obj.py", line 228, in alter_rls_statement
return self.alter_table_statement(self.alter_rls_clause)
File "/usr/local/lib/python3.9/site-packages/schemainspect/pg/obj.py", line 145, in alter_table_statement
raise NotImplementedError # pragma: no cover
NotImplementedError

Additional context
Seems like migra tool is creating an issue on policies. But happening only with partition table. It works fine if the tables are not partitioned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions