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:
Diffstat (limited to 'db/migrate/20161129161957_create_table_project_metrics.rb')
-rw-r--r--db/migrate/20161129161957_create_table_project_metrics.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20161129161957_create_table_project_metrics.rb b/db/migrate/20161129161957_create_table_project_metrics.rb
new file mode 100644
index 00000000000..21aeec74fe9
--- /dev/null
+++ b/db/migrate/20161129161957_create_table_project_metrics.rb
@@ -0,0 +1,18 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class CreateTableProjectMetrics < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ create_table :project_metrics do |t|
+ t.integer :project_id, null: false
+ t.integer :shared_runners_minutes, default: 0, null: false
+ end
+
+ add_foreign_key :project_metrics, :projects, column: :project_id, on_delete: :cascade
+ end
+end