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:
converted_at timestamp with time zone
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
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides - [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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