2021-06-08 01:23:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreatePackagesHelmFileMetadata < ActiveRecord::Migration[6.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2022-04-04 11:22:00 +05:30
|
|
|
def up
|
2021-06-08 01:23:25 +05:30
|
|
|
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
|
2022-04-04 11:22:00 +05:30
|
|
|
|
|
|
|
def down
|
|
|
|
with_lock_retries do
|
|
|
|
drop_table :packages_helm_file_metadata
|
|
|
|
end
|
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|