Commit 2fc8048c authored by Toon Claes's avatar Toon Claes

Merge branch '297664-maintain-data-parity-between-experimentuser-experimentsubject' into 'master'

Maintain data parity between ExperimentUser & ExperimentSubject

See merge request gitlab-org/gitlab!51659
parents b4eb706e 63e0387c
---
title: Add converted_at(timestamp) & context(jsonb) columns to the experiment_subjects
table
merge_request: 51659
author:
type: changed
# frozen_string_literal: true
class AddConvertedAtToExperimentSubjects < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
add_column :experiment_subjects, :converted_at, :datetime_with_timezone
end
end
# frozen_string_literal: true
class AddContextToExperimentSubjects < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
add_column :experiment_subjects, :context, :jsonb, default: {}, null: false
end
end
1a430ce6d137ee896cbd37bb822ccd18c9e87204b765b1192928dd82efb28602
\ No newline at end of file
5d7bbf376acbf5679d111866e70b69eebba26a487a9e7d6bd571f15dc423e3e3
\ No newline at end of file
......@@ -12261,6 +12261,8 @@ CREATE TABLE experiment_subjects (
variant smallint DEFAULT 0 NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
converted_at timestamp with time zone,
context jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT chk_has_one_subject CHECK ((num_nonnulls(user_id, group_id, project_id) = 1))
);
......
......@@ -184,6 +184,7 @@ RSpec.describe 'Database schema' do
"ApplicationSetting" => %w[repository_storages_weighted],
"AlertManagement::Alert" => %w[payload],
"Ci::BuildMetadata" => %w[config_options config_variables],
"ExperimentSubject" => %w[context],
"ExperimentUser" => %w[context],
"Geo::Event" => %w[payload],
"GeoNodeStatus" => %w[status],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment