summaryrefslogtreecommitdiff
path: root/db/migrate/20190605184422_create_namespace_aggregation_schedules.rb
blob: 5e8cb616cc1fc81ca7b407590fa5070cef4e9da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

class CreateNamespaceAggregationSchedules < ActiveRecord::Migration[5.1]
  DOWNTIME = false

  def change
    create_table :namespace_aggregation_schedules, id: false, primary_key: :namespace_id do |t|
      t.integer :namespace_id, null: false, primary_key: true

      t.index :namespace_id, unique: true
      t.foreign_key :namespaces, column: :namespace_id, on_delete: :cascade
    end
  end
end