Right now general_log_channel_id is just a string value representing the Slack Channel ID (ex. C043HQ70QMB). This PR migrates this instead to be a foreign key relationship on the slack_slackchannel table and updates all references to general_log_channel_id.
Tested migrations locally:
Operations to perform:
Apply all migrations: [redacted secret grafana-admin-creds:admin-user], alerts, auth, auth_token, base, contenttypes, email, exotel, fcm_django, google, heartbeat, labels, mobile_app, oss_installation, phone_notifications, schedules, sessions, slack, social_django, telegram, twilioapp, user_management, webhooks, zvonok
Running migrations:
Applying user_management.0024_organization_general_log_slack_channel... OK
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Starting migration to populate general_log_slack_channel field.
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Total organizations to process: 1
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Organization 1 updated with SlackChannel 2 (slack_id: C043LL6RTS7).
source=engine:app google_trace_id=none logger=apps.user_management.migrations.0025_auto_20241017_1919 Finished migration. Total organizations processed: 1. Organizations updated: 1. Missing SlackChannels: 0.
Applying user_management.0025_auto_20241017_1919... OK
Future incoming PRs
Drop Organization.general_log_channel_id column
Migrate ChannelFilter.slack_channel_id and ResolutionNoteSlackMessage.slack_channel_id to use foreign key relationships
Checklist
[x] Unit, integration, and e2e (if applicable) tests updated
[x] Documentation added (or pr:no public docs PR label added if not required)
[x] Added the relevant release notes label (see labels prefixed w/ release:). These labels dictate how your PR will
show up in the autogenerated release notes.
What this PR does
Related to https://github.com/grafana/oncall-private/issues/2947
Right now
general_log_channel_id
is just a string value representing the Slack Channel ID (ex.C043HQ70QMB
). This PR migrates this instead to be a foreign key relationship on theslack_slackchannel
table and updates all references togeneral_log_channel_id
.Tested migrations locally:
Future incoming PRs
Organization.general_log_channel_id
columnChannelFilter.slack_channel_id
andResolutionNoteSlackMessage.slack_channel_id
to use foreign key relationshipsChecklist
pr:no public docs
PR label added if not required)release:
). These labels dictate how your PR will show up in the autogenerated release notes.