Modify `vs_code_settings` table schema

MR: Update vs_code_settings table schema (!171582 - merged)

Description

With the introduction of the extensions marketplace context within Settings Sync, there are several changes to be made to the table schema:

  • We want to store the settings_context_hash in the vs_code_settings table in order to lookup extension settings based on the extensions marketplace context. This field will be a null-able string with a max character limit of 255.
  • Currently, there is a unique index on the user_id and settings_type fields. This constraint is no longer true as we introduce multiple records for each user and setting type. In the context of this epic, a user can now have multiple extensions records with different settings_context_hash.
    • We'll want to confirm with a DB maintainer in the MR for preference on whether we should add an index at all. If we need an index, confirm if an index on the user_id field would suffice.

Acceptance Criteria

  • Migration to add new column to vs_code_settings table.
  • Add uniqueness validation in the VSCodeSetting model.
  • Migration to update current unique index to include settings_context_hash to enforce uniqueness at the database level. Here's an example.
Edited by Cindy Halim