feat: Move default channel to app table#1107
Closed
WcaleNieWolny wants to merge 47 commits into
Closed
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Move default channel to app table
Summary
Overview
This PR implements the first part of moving default channel configurations from individual channel records to the application level. This architectural change allows for more centralized management of default channel settings and improves the update delivery workflow.
Changes
Database Schema:
Added new columns to the apps table:
default_channel_ios: Foreign key reference to channels table
default_channel_android: Foreign key reference to channels table
default_channel_sync: Boolean flag to control if iOS and Android channels are synchronized
Removed public column from the channels table
Added migration script to populate these new fields for existing apps
Backend Changes:
Updated API endpoints in channel/get.ts and channel/post.ts to handle the new structure
Modified database utility functions to support the new schema
Updated Supabase type definitions to reflect the database changes
UI Enhancements:
Redesigned app settings page with dedicated section for managing default channels
Added UI for toggling channel sync between platforms
Implemented separate controls for iOS and Android default channels when not synced
Added dialogs for channel selection and confirmation
Localization:
Added new translation keys for default channel settings
Updated existing translations in multiple languages
Technical Details
ON DELETE SET NULL constraints added to foreign key references, ensuring apps can still function if a channel is deleted
Migration automatically determines if existing apps have synced channels and sets the flag accordingly
Added channel sync toggle in the UI with confirmation dialog when switching from separate to synced mode
Summary by CodeRabbit