summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190726114448_create_background_counter_table.rb18
-rw-r--r--db/schema.rb9
2 files changed, 26 insertions, 1 deletions
diff --git a/db/migrate/20190726114448_create_background_counter_table.rb b/db/migrate/20190726114448_create_background_counter_table.rb
new file mode 100644
index 00000000000..09a4bf11df8
--- /dev/null
+++ b/db/migrate/20190726114448_create_background_counter_table.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateBackgroundCounterTable < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def change
+ create_table :background_counters do |t|
+ t.string :identifier, null: false, limit: 100
+
+ t.datetime_with_timezone :updated_at, null: false
+ t.bigint :counter_value, null: false, default: 0
+
+ t.index :identifier, unique: true
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 67479937b47..e2e75db02ee 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_07_25_012225) do
+ActiveRecord::Schema.define(version: 2019_07_26_114448) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -355,6 +355,13 @@ ActiveRecord::Schema.define(version: 2019_07_25_012225) do
t.index ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name"
end
+ create_table "background_counters", force: :cascade do |t|
+ t.string "identifier", limit: 100, null: false
+ t.datetime_with_timezone "updated_at", null: false
+ t.bigint "counter_value", default: 0, null: false
+ t.index ["identifier"], name: "index_background_counters_on_identifier", unique: true
+ end
+
create_table "badges", id: :serial, force: :cascade do |t|
t.string "link_url", null: false
t.string "image_url", null: false