fix: handle database permission issues in sync migration verification

Sync was blocked because the migration registry table creation required
CREATE TABLE permissions that the database user might not have.

Changes:
- Check if migration registry tables exist before attempting to create them
- Skip creation if table exists and user lacks CREATE permissions
- Use information_schema to reliably check table existence
- Apply same fix to user sync status table creation
- Gracefully handle ALTER TABLE failures for backward compatibility

This allows sync to proceed even if the client is a read-limited database user,
as long as the required tables have already been created by an administrator.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail ChusavitinandClaude Haiku 4.5 committed 2026-02-09 11:22:33 +03:00
1 parent 0a984a5085
commit 024a540ad0
4 files changed
+369 -41

No files matched your search

BIN
View File
Binary file not shown.