diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 18:06:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-15 18:06:01 +0000 |
commit | 7b8ec6e718331dd1f8330f08f49f01ba2c20b84c (patch) | |
tree | 560992bd23b96c85e8b006258a8ece3fb25d088e /db | |
parent | 03087faa6b679cd82a8a7b5f6491edc414ed91eb (diff) | |
download | gitlab-ce-7b8ec6e718331dd1f8330f08f49f01ba2c20b84c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20191004134055_drop_unused_analytics_repository_file_edits.rb | 32 | ||||
-rw-r--r-- | db/schema.rb | 13 |
2 files changed, 12 insertions, 33 deletions
diff --git a/db/post_migrate/20191004134055_drop_unused_analytics_repository_file_edits.rb b/db/post_migrate/20191004134055_drop_unused_analytics_repository_file_edits.rb deleted file mode 100644 index 7bf92080fe6..00000000000 --- a/db/post_migrate/20191004134055_drop_unused_analytics_repository_file_edits.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class DropUnusedAnalyticsRepositoryFileEdits < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - # The table was never used, there is no app code that writes or reads the table. Safe to remove. - drop_table :analytics_repository_file_edits - end - - def down - create_table :analytics_repository_file_edits do |t| - t.references :project, - index: true, - foreign_key: { on_delete: :cascade }, null: false - t.references :analytics_repository_file, - index: false, - foreign_key: { on_delete: :cascade }, - null: false - t.date :committed_date, - null: false - t.integer :num_edits, - null: false, - default: 0 - end - - add_index :analytics_repository_file_edits, - [:analytics_repository_file_id, :committed_date, :project_id], - name: 'index_file_edits_on_committed_date_file_id_and_project_id', - unique: true - end -end diff --git a/db/schema.rb b/db/schema.rb index 1b1a6773c14..b9952cfc12d 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_10_04_134055) do +ActiveRecord::Schema.define(version: 2019_10_04_133612) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -102,6 +102,15 @@ ActiveRecord::Schema.define(version: 2019_10_04_134055) do t.index ["project_id", "committed_date", "analytics_repository_file_id"], name: "index_file_commits_on_committed_date_file_id_and_project_id", unique: true end + create_table "analytics_repository_file_edits", force: :cascade do |t| + t.bigint "project_id", null: false + t.bigint "analytics_repository_file_id", null: false + t.date "committed_date", null: false + t.integer "num_edits", default: 0, null: false + t.index ["analytics_repository_file_id", "committed_date", "project_id"], name: "index_file_edits_on_committed_date_file_id_and_project_id", unique: true + t.index ["project_id"], name: "index_analytics_repository_file_edits_on_project_id" + end + create_table "analytics_repository_files", force: :cascade do |t| t.bigint "project_id", null: false t.string "file_path", limit: 4096, null: false @@ -3900,6 +3909,8 @@ ActiveRecord::Schema.define(version: 2019_10_04_134055) do add_foreign_key "analytics_language_trend_repository_languages", "projects", on_delete: :cascade add_foreign_key "analytics_repository_file_commits", "analytics_repository_files", on_delete: :cascade add_foreign_key "analytics_repository_file_commits", "projects", on_delete: :cascade + add_foreign_key "analytics_repository_file_edits", "analytics_repository_files", on_delete: :cascade + add_foreign_key "analytics_repository_file_edits", "projects", on_delete: :cascade add_foreign_key "analytics_repository_files", "projects", on_delete: :cascade add_foreign_key "application_settings", "namespaces", column: "custom_project_templates_group_id", on_delete: :nullify add_foreign_key "application_settings", "projects", column: "file_template_project_id", name: "fk_ec757bd087", on_delete: :nullify |