Commit e5b48221 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix migrations

parent b5b9b321
......@@ -5,7 +5,7 @@ class CreateTableNamespaceMetrics < ActiveRecord::Migration
def change
create_table :namespace_metrics do |t|
t.integer :namespace_id, null: false, unique: true
t.integer :namespace_id, null: false
t.integer :shared_runners_minutes, default: 0, null: false
t.timestamp :shared_runners_minutes_last_reset
end
......
......@@ -5,7 +5,7 @@ class CreateTableProjectMetrics < ActiveRecord::Migration
def change
create_table :project_metrics do |t|
t.integer :project_id, null: false, unique: true
t.integer :project_id, null: false
t.integer :shared_runners_minutes, default: 0, null: false
t.timestamp :shared_runners_minutes_last_reset
end
......
class AddIndexToNamespaceMetrics < ActiveRecord::Migration
class AddIndexToProjectMetrics < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
......
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161202152039) do
ActiveRecord::Schema.define(version: 20161202152041) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -822,6 +822,7 @@ ActiveRecord::Schema.define(version: 20161202152039) do
create_table "namespace_metrics", force: :cascade do |t|
t.integer "namespace_id", null: false
t.integer "shared_runners_minutes", default: 0, null: false
t.datetime "shared_runners_minutes_last_reset"
end
add_index "namespace_metrics", ["namespace_id"], name: "index_namespace_metrics_on_namespace_id", unique: true, using: :btree
......@@ -1033,6 +1034,14 @@ ActiveRecord::Schema.define(version: 20161202152039) do
add_index "project_import_data", ["project_id"], name: "index_project_import_data_on_project_id", using: :btree
create_table "project_metrics", force: :cascade do |t|
t.integer "project_id", null: false
t.integer "shared_runners_minutes", default: 0, null: false
t.datetime "shared_runners_minutes_last_reset"
end
add_index "project_metrics", ["project_id"], name: "index_project_metrics_on_project_id", unique: true, using: :btree
create_table "projects", force: :cascade do |t|
t.string "name"
t.string "path"
......@@ -1493,6 +1502,7 @@ ActiveRecord::Schema.define(version: 20161202152039) do
add_foreign_key "personal_access_tokens", "users"
add_foreign_key "project_authorizations", "projects", on_delete: :cascade
add_foreign_key "project_authorizations", "users", on_delete: :cascade
add_foreign_key "project_metrics", "projects", on_delete: :cascade
add_foreign_key "protected_branch_merge_access_levels", "namespaces", column: "group_id"
add_foreign_key "protected_branch_merge_access_levels", "protected_branches"
add_foreign_key "protected_branch_merge_access_levels", "users"
......
......@@ -9,7 +9,7 @@ FactoryGirl.define do
end
trait :with_used_limit do
namespace_metrics factory: :namespace_metrics, :with_used_limit
namespace_metrics factory: :namespace_metrics, shared_runners_minutes: 1000
shared_runners_minutes_limit 500
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment