Skip to content

Fix view migration issue#48

Merged
rkistner merged 3 commits intomainfrom
fix-triggers-migration
Dec 11, 2024
Merged

Fix view migration issue#48
rkistner merged 3 commits intomainfrom
fix-triggers-migration

Conversation

@rkistner
Copy link
Contributor

@rkistner rkistner commented Dec 6, 2024

If there are triggers referring to PowerSync views, the current migration that drops existing views can cause issues (see the test). This would manifest in an error such as:

powersync_init error in trigger my_trigger: no such table: main.my_table

This changes the migration to only drop the triggers, instead of completely dropping the views. (Technically we do still drop the views, but they are immediately re-created, avoiding the issue.)

See the Discord thread for context.

@rkistner rkistner force-pushed the fix-triggers-migration branch from 9516c74 to 3d5d75f Compare December 6, 2024 14:57
@rkistner rkistner marked this pull request as ready for review December 10, 2024 12:01
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

Successfully merging this pull request may close these issues.

2 participants