diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-11-23 05:33:07 +0100 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2018-11-26 23:39:05 +0100 |
commit | fe2e6c6dc046748f8760bfbb3c74185bdbf1359b (patch) | |
tree | 2e95576786cb3936b7442c420a5ccf42ddfa266d /db | |
parent | deaf3af7e5f357f3e8d91f7f2d49ad3ce001ba68 (diff) | |
download | gitlab-ce-fe2e6c6dc046748f8760bfbb3c74185bdbf1359b.tar.gz |
Remove Site Statistic53778-remove-site-statistics
This approach caused many different problems as we tightened
the query execution timeout.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20181123042307_drop_site_statistics.rb | 22 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 22 insertions, 4 deletions
diff --git a/db/migrate/20181123042307_drop_site_statistics.rb b/db/migrate/20181123042307_drop_site_statistics.rb new file mode 100644 index 00000000000..8986374ef65 --- /dev/null +++ b/db/migrate/20181123042307_drop_site_statistics.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropSiteStatistics < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + drop_table :site_statistics + end + + def down + create_table :site_statistics do |t| + t.integer :repositories_count, default: 0, null: false + end + + execute('INSERT INTO site_statistics (id) VALUES(1)') + end +end diff --git a/db/schema.rb b/db/schema.rb index acabd7b442b..3c02469250d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1885,10 +1885,6 @@ ActiveRecord::Schema.define(version: 20181126150622) do t.index ["name"], name: "index_shards_on_name", unique: true, using: :btree end - create_table "site_statistics", force: :cascade do |t| - t.integer "repositories_count", default: 0, null: false - end - create_table "snippets", force: :cascade do |t| t.string "title" t.text "content" |