1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# frozen_string_literal: true
class CreatePackagesDebianFileMetadata < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
unless table_exists?(:packages_debian_file_metadata)
create_table :packages_debian_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.integer :file_type, limit: 2, null: false
t.text :component
t.text :architecture
t.jsonb :fields
end
end
add_text_limit :packages_debian_file_metadata, :component, 255
add_text_limit :packages_debian_file_metadata, :architecture, 255
end
def down
drop_table :packages_debian_file_metadata
end
end
|