Skip to content
Snippets Groups Projects
Commit d0200b5b authored by Shane Maglangit's avatar Shane Maglangit :three:
Browse files

Add NOT NULL constraint to ml_experiment_metadata.project_id column

Changelog: other
parent 7ae65916
No related branches found
No related tags found
3 merge requests!181325Fix ambiguous `created_at` in project.rb,!180187Draft: Update dashboard editing to save visualizations directly to the dashboard file,!177249Add NOT NULL for sharding key on ml_experiment_metadata
......@@ -8,14 +8,6 @@ gitlab_schema: gitlab_main_cell
description: An Experiment Metadata record holds extra information about the experiment
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104267
milestone: '15.7'
desired_sharding_key:
project_id:
references: projects
backfill_via:
parent:
foreign_key: experiment_id
table: ml_experiments
sharding_key: project_id
belongs_to: experiment
desired_sharding_key_migration_job_name: BackfillMlExperimentMetadataProjectId
table_size: small
sharding_key:
project_id: projects
# frozen_string_literal: true
class AddMlExperimentMetadataProjectIdNotNullConstraint < Gitlab::Database::Migration[2.2]
disable_ddl_transaction!
milestone '17.9'
def up
add_not_null_constraint :ml_experiment_metadata, :project_id
end
def down
remove_not_null_constraint :ml_experiment_metadata, :project_id
end
end
4c5c6a0805f9e43ef76364ce1282c88b2a334dbefc6e50b1fe95f0dd4ec85d18
\ No newline at end of file
......@@ -15448,7 +15448,8 @@ CREATE TABLE ml_experiment_metadata (
value text NOT NULL,
project_id bigint,
CONSTRAINT check_112fe5002d CHECK ((char_length(name) <= 255)),
CONSTRAINT check_a91c633d68 CHECK ((char_length(value) <= 5000))
CONSTRAINT check_a91c633d68 CHECK ((char_length(value) <= 5000)),
CONSTRAINT check_ca9b8315ef CHECK ((project_id IS NOT NULL))
);
 
CREATE SEQUENCE ml_experiment_metadata_id_seq
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment