Prepare to fully shard gpg_key_subkeys

Relates to #582331

What does this MR do?

Prepares the gpg_key_subkeys table for full sharding by establishing the relationship between GPG subkeys and users. Since GPG subkeys belong to GPG keys, and GPG keys belong to users, this change ensures subkeys can be properly distributed across database shards based on user ownership.

Why is this needed?

As part of our database sharding strategy, tables need to include the appropriate sharding key to enable data distribution. The gpg_key_subkeys table currently lacks a direct reference to users, which is required for sharding by user.

What changes?

  • GPG subkeys will be associated with their owning user
  • Existing records will be updated to reflect the correct user ownership
  • New records will automatically maintain this relationship
Edited by Tomasz Skorupa

Merge request reports

Loading