diff options
author | Nick Thomas <nick@gitlab.com> | 2018-10-19 13:17:50 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-11-05 01:30:04 +0000 |
commit | f760c1cd17881c8aef3a33a3b43db54673db8111 (patch) | |
tree | e1ed99cee3bd9bce1b60f2487d967e8187b110c2 /db | |
parent | 93846eb152f32e149ef8c24b707fa0a0c0c52714 (diff) | |
download | gitlab-ce-f760c1cd17881c8aef3a33a3b43db54673db8111.tar.gz |
Start tracking shards in the database
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20181019032400_add_shards_table.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20181019032400_add_shards_table.rb b/db/migrate/20181019032400_add_shards_table.rb new file mode 100644 index 00000000000..5e0a6960548 --- /dev/null +++ b/db/migrate/20181019032400_add_shards_table.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddShardsTable < ActiveRecord::Migration + DOWNTIME = false + + def change + create_table :shards do |t| + t.string :name, null: false, index: { unique: true } + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1a8b556228d..439f70b0198 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1931,6 +1931,12 @@ ActiveRecord::Schema.define(version: 20181101144347) do add_index "services", ["project_id"], name: "index_services_on_project_id", using: :btree add_index "services", ["template"], name: "index_services_on_template", using: :btree + create_table "shards", force: :cascade do |t| + t.string "name", null: false + end + + add_index "shards", ["name"], name: "index_shards_on_name", unique: true, using: :btree + create_table "site_statistics", force: :cascade do |t| t.integer "repositories_count", default: 0, null: false end |