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
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2018-11-29 20:47:25 +0300
committerGabriel Mazetto <brodock@gmail.com>2018-11-29 20:47:25 +0300
commit6cd2c0a7ec22ebf6da4ec372e13bd2921543d8a3 (patch)
tree4fd0e9f61314a7b36a2c926db541155a033197ec /db/post_migrate
parent77c26777357d3a8a1fa9f7c9d9a9e9cd956029f3 (diff)
Move drop_site_statistics to be a post deployment migration
As post deployment migration we don't need to make it a migration that requires downtime
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20181123042307_drop_site_statistics.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/post_migrate/20181123042307_drop_site_statistics.rb b/db/post_migrate/20181123042307_drop_site_statistics.rb
new file mode 100644
index 00000000000..8986374ef65
--- /dev/null
+++ b/db/post_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