Skip to content

Maintain data parity between ExperimentUser & ExperimentSubject

What does this MR do?

Maintains parity between the limited and likely-soon-to-be-defunct ExperimentUser model & its meant-to-be-replacement model, ExperimentSubject.

The experiment_users database table is currently two columns ahead of the experiment_subjects table:

  1. converted_at timestamp with time zone
  2. context jsonb DEFAULT '{}'::jsonb NOT NULL

A changelog is included as this is a database change. No documentation has been added or updated as ExperimentSubject is not currently documented.

Data Migrations

UP

== 20210113231532 AddConvertedAtToExperimentSubjects: migrating ===============
-- add_column(:experiment_subjects, :converted_at, :datetime_with_timezone)
   -> 0.0022s
== 20210113231532 AddConvertedAtToExperimentSubjects: migrated (0.0022s) ======

== 20210113231546 AddContextToExperimentSubjects: migrating ===================
-- add_column(:experiment_subjects, :context, :jsonb, {:default=>{}, :null=>false})
   -> 0.0031s
== 20210113231546 AddContextToExperimentSubjects: migrated (0.0078s) ==========

DOWN

== 20210113231546 AddContextToExperimentSubjects: reverting ===================
-- remove_column(:experiment_subjects, :context)
   -> 0.0018s
== 20210113231546 AddContextToExperimentSubjects: reverted (0.0084s) ==========

== 20210113231532 AddConvertedAtToExperimentSubjects: reverting ===============
-- remove_column(:experiment_subjects, :converted_at, :datetime_with_timezone)
   -> 0.0011s
== 20210113231532 AddConvertedAtToExperimentSubjects: reverted (0.0042s) ======

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team

Related to #297664 (closed)

Edited by Dallas Reedy

Merge request reports