Commit d7b1d778 authored by Mathieu Parent's avatar Mathieu Parent

Create packages_helm_file_metadata table

Item 2.1 of https://gitlab.com/gitlab-org/gitlab/-/issues/18997#note_530270349
parent c4e9c384
---
title: Create packages_helm_file_metadata table
merge_request: 57017
author: Mathieu Parent
type: added
# frozen_string_literal: true
class CreatePackagesHelmFileMetadata < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
create_table_with_constraints :packages_helm_file_metadata, id: false do |t|
t.timestamps_with_timezone
t.references :package_file, primary_key: true, index: false, default: nil, null: false, foreign_key: { to_table: :packages_package_files, on_delete: :cascade }, type: :bigint
t.text :channel, null: false
t.jsonb :metadata
t.text_limit :channel, 63
t.index :channel
end
end
end
b17c853b2bc82cfa83cd82b8023eca39d875d898b99e78c81d767a73391a0b75
\ No newline at end of file
......@@ -15639,6 +15639,15 @@ CREATE SEQUENCE packages_events_id_seq
ALTER SEQUENCE packages_events_id_seq OWNED BY packages_events.id;
CREATE TABLE packages_helm_file_metadata (
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
package_file_id bigint NOT NULL,
channel text NOT NULL,
metadata jsonb,
CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63))
);
CREATE TABLE packages_maven_metadata (
id bigint NOT NULL,
package_id bigint NOT NULL,
......@@ -21274,6 +21283,9 @@ ALTER TABLE ONLY packages_dependency_links
ALTER TABLE ONLY packages_events
ADD CONSTRAINT packages_events_pkey PRIMARY KEY (id);
ALTER TABLE ONLY packages_helm_file_metadata
ADD CONSTRAINT packages_helm_file_metadata_pkey PRIMARY KEY (package_file_id);
ALTER TABLE ONLY packages_maven_metadata
ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id);
......@@ -23609,6 +23621,8 @@ CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_depend
CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree (package_id);
CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel);
CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path);
CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path);
......@@ -26647,6 +26661,9 @@ ALTER TABLE ONLY fork_network_members
ALTER TABLE ONLY operations_feature_flag_scopes
ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
ALTER TABLE ONLY packages_helm_file_metadata
ADD CONSTRAINT fk_rails_a559865345 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE;
ALTER TABLE ONLY cluster_projects
ADD CONSTRAINT fk_rails_a5a958bca1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
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