Commit 6f984e59 authored by Sean Carroll's avatar Sean Carroll

Add `link_type` column to `release_assets` table

Part of https://gitlab.com/gitlab-org/gitlab/-/issues/207257

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33156
parent 5111b545
......@@ -14,6 +14,13 @@ module Releases
scope :sorted, -> { order(created_at: :desc) }
enum link_type: {
other: 0,
runbook: 1,
package: 2,
image: 3
}
def internal?
url.start_with?(release.project.web_url)
end
......
---
title: Add link_type column to release_links table
merge_request: 33156
author:
type: changed
# frozen_string_literal: true
class AddLinkTypeToReleaseLinks < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
add_column :release_links, :link_type, :integer, limit: 2, default: 0
end
end
def down
with_lock_retries do
remove_column :release_links, :link_type
end
end
end
......@@ -5730,7 +5730,8 @@ CREATE TABLE public.release_links (
name character varying NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
filepath character varying(128)
filepath character varying(128),
link_type smallint DEFAULT 0
);
CREATE SEQUENCE public.release_links_id_seq
......@@ -14031,6 +14032,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200526153844
20200526164946
20200526164947
20200527092027
20200527094322
20200527095401
20200527151413
......
......@@ -144,6 +144,7 @@ Releases::Link:
- url
- name
- filepath
- link_type
- created_at
- updated_at
ProjectMember:
......
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