Skip to content
代码片段 群组 项目
未验证 提交 cb3aec1d 编辑于 作者: Adam Hegyi's avatar Adam Hegyi 提交者: GitLab
浏览文件

Merge branch 'add-ci-component-usage-count-columns' into 'master'

Add usage count column to CI catalog_resources and components tables

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/147293



Merged-by: default avatarAdam Hegyi <ahegyi@gitlab.com>
Approved-by: default avatarAdam Hegyi <ahegyi@gitlab.com>
Reviewed-by: default avatarMohamed Hamda <mhamda@gitlab.com>
Co-authored-by: default avatarlma-git <lma@gitlab.com>
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true
class AddUsageCountToCatalogResources < Gitlab::Database::Migration[2.2]
milestone '16.11'
def change
add_column :catalog_resources, :last_30_day_usage_count, :integer, null: false, default: 0
add_column :catalog_resources, :last_30_day_usage_count_updated_at, :datetime_with_timezone,
null: false, default: '1970-01-01'
end
end
# frozen_string_literal: true
class AddUsageCountToCatalogResourceComponents < Gitlab::Database::Migration[2.2]
milestone '16.11'
def change
add_column :catalog_resource_components, :last_30_day_usage_count, :integer, null: false, default: 0
add_column :catalog_resource_components, :last_30_day_usage_count_updated_at, :datetime_with_timezone,
null: false, default: '1970-01-01'
end
end
98454d2080cba05c35033694887f7dbb68965015e19e323e35b48bf6b1c0c893
\ No newline at end of file
77f42280c79176fa52da6f202067dc67128c2f3fa384d1d84624938312325fc7
\ No newline at end of file
......@@ -5649,6 +5649,8 @@ CREATE TABLE catalog_resource_components (
name text NOT NULL,
path text,
spec jsonb DEFAULT '{}'::jsonb NOT NULL,
last_30_day_usage_count integer DEFAULT 0 NOT NULL,
last_30_day_usage_count_updated_at timestamp with time zone DEFAULT '1970-01-01 00:00:00+00'::timestamp with time zone NOT NULL,
CONSTRAINT check_a76bfd47fe CHECK ((char_length(path) <= 255)),
CONSTRAINT check_ddca729980 CHECK ((char_length(name) <= 255))
);
......@@ -5695,7 +5697,9 @@ CREATE TABLE catalog_resources (
description text,
visibility_level integer DEFAULT 0 NOT NULL,
search_vector tsvector GENERATED ALWAYS AS ((setweight(to_tsvector('english'::regconfig, (COALESCE(name, ''::character varying))::text), 'A'::"char") || setweight(to_tsvector('english'::regconfig, COALESCE(description, ''::text)), 'B'::"char"))) STORED,
verification_level smallint DEFAULT 0
verification_level smallint DEFAULT 0,
last_30_day_usage_count integer DEFAULT 0 NOT NULL,
last_30_day_usage_count_updated_at timestamp with time zone DEFAULT '1970-01-01 00:00:00+00'::timestamp with time zone NOT NULL
);
 
CREATE SEQUENCE catalog_resources_id_seq
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册