gitlab-org--gitlab-foss/db/migrate/20190605184422_create_namespace_aggregation_schedules.rb
Mayra Cabrera bde41ee866 Add two new ActiveRecord models
- Namespace::Storagestatistics will persist root namespace statistics
- Namespace::AggregationSchedule will save information when a new update
to the namespace statistics needs to be scheduled

Both tables use 'namespace_id' as primary key
2019-06-25 09:54:47 -05:00

14 lines
432 B
Ruby

# 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