summaryrefslogtreecommitdiff
path: root/db/migrate/20180629153018_create_site_statistics.rb
blob: 60a32b3b2a7b01165b6c790db362c4fe3134b915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class CreateSiteStatistics < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def up
    create_table :site_statistics do |t|
      t.integer :repositories_count, default: 0, null: false
      t.integer :wikis_count, default: 0, null: false
    end

    execute('INSERT INTO site_statistics (id) VALUES(1)')
  end

  def down
    drop_table :site_statistics
  end
end