Commit 63e0387c authored by Dallas Reedy's avatar Dallas Reedy

Maintain database parity between experiment_users & experiment_subjects

- Add converted_at(timestamp) column to experiment_subjects
- Add context(jsonb) column to experiment_subjects
- Add a changelog entry for database changes
parent c095fcc7
---
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