summaryrefslogtreecommitdiff
path: root/db/migrate/20201204111600_create_packages_debian_publications.rb
blob: 2fd26c2c367953be6e0ed4792d57a20c2f8f638c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class CreatePackagesDebianPublications < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def change
    create_table :packages_debian_publications do |t|
      t.references :package,
        index: { unique: true },
        null: false,
        foreign_key: { to_table: :packages_packages, on_delete: :cascade }
      t.references :distribution,
        null: false,
        foreign_key: { to_table: :packages_debian_project_distributions, on_delete: :cascade }
    end
  end
end