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

Fix view migration issue #48

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Fix view migration issue #48

merged 3 commits into from
Dec 11, 2024

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