Skip to content
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

Migration issue with supabase db diff for partition tables #2970

Open
HimaniShah1 opened this issue Dec 12, 2024 · 1 comment
Open

Migration issue with supabase db diff for partition tables #2970

HimaniShah1 opened this issue Dec 12, 2024 · 1 comment

Comments

@HimaniShah1
Copy link

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.

@HimaniShah1
Copy link
Author

@sweatybridge Could you please help me with this issue?

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

No branches or pull requests

1 participant