From 5ae9a44aa17c8929627cc450f936cd960c143e25 Mon Sep 17 00:00:00 2001 From: Jacopo Date: Thu, 13 Dec 2018 20:26:56 +0100 Subject: Add project http fetch statistics API The API get projects/:id/traffic/fetches allows user with write access to the repository to get the number of clones for the last 30 days. --- .../20181205171941_create_project_daily_statistics.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 db/migrate/20181205171941_create_project_daily_statistics.rb (limited to 'db/migrate') diff --git a/db/migrate/20181205171941_create_project_daily_statistics.rb b/db/migrate/20181205171941_create_project_daily_statistics.rb new file mode 100644 index 00000000000..c9e2a1e1aa7 --- /dev/null +++ b/db/migrate/20181205171941_create_project_daily_statistics.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateProjectDailyStatistics < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :project_daily_statistics, id: :bigserial do |t| + t.integer :project_id, null: false + t.integer :fetch_count, null: false + t.date :date + + t.index [:project_id, :date], unique: true, order: { date: :desc } + t.foreign_key :projects, on_delete: :cascade + end + end +end -- cgit v1.2.1