Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2018-11-23 07:33:07 +0300
committerGabriel Mazetto <brodock@gmail.com>2018-11-27 01:39:05 +0300
commitfe2e6c6dc046748f8760bfbb3c74185bdbf1359b (patch)
tree2e95576786cb3936b7442c420a5ccf42ddfa266d /db
parentdeaf3af7e5f357f3e8d91f7f2d49ad3ce001ba68 (diff)
Remove Site Statistic
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.rb22
-rw-r--r--db/schema.rb4
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"