diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-07 21:07:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-07 21:07:34 +0300 |
commit | 8dafc3b65aeb8f50fdfc38fb98d96c3db9e2f607 (patch) | |
tree | ecc8ff28071e68108aea21380d80132e388d48bf /db | |
parent | b4028d450087e97f26d4baa23e08396bcbabe3e0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20191126134210_rename_packages_package_tags.rb | 9 | ||||
-rw-r--r-- | db/migrate/20200106085831_add_timestamps_to_packages_tags.rb | 23 | ||||
-rw-r--r-- | db/schema.rb | 19 |
3 files changed, 43 insertions, 8 deletions
diff --git a/db/migrate/20191126134210_rename_packages_package_tags.rb b/db/migrate/20191126134210_rename_packages_package_tags.rb new file mode 100644 index 00000000000..75cb53802ab --- /dev/null +++ b/db/migrate/20191126134210_rename_packages_package_tags.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class RenamePackagesPackageTags < ActiveRecord::Migration[5.2] + DOWNTIME = false + + def change + rename_table(:packages_package_tags, :packages_tags) + end +end diff --git a/db/migrate/20200106085831_add_timestamps_to_packages_tags.rb b/db/migrate/20200106085831_add_timestamps_to_packages_tags.rb new file mode 100644 index 00000000000..2720d9b3297 --- /dev/null +++ b/db/migrate/20200106085831_add_timestamps_to_packages_tags.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTimestampsToPackagesTags < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + # We disable these cops here because adding this column is safe. The table does not + # have any data in it. + # rubocop: disable Migration/AddIndex + def up + add_timestamps_with_timezone(:packages_tags, null: false) + add_index(:packages_tags, [:package_id, :updated_at], order: { updated_at: :desc }) + end + + # We disable these cops here because adding this column is safe. The table does not + # have any data in it. + # rubocop: disable Migration/RemoveIndex + def down + remove_index(:packages_tags, [:package_id, :updated_at]) + remove_timestamps(:packages_tags) + end +end diff --git a/db/schema.rb b/db/schema.rb index 3ead1f38ac3..2b6f8474412 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: 2020_01_06_071113) do +ActiveRecord::Schema.define(version: 2020_01_06_085831) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -2938,12 +2938,6 @@ ActiveRecord::Schema.define(version: 2020_01_06_071113) do t.index ["package_id", "file_name"], name: "index_packages_package_files_on_package_id_and_file_name" end - create_table "packages_package_tags", force: :cascade do |t| - t.integer "package_id", null: false - t.string "name", limit: 255, null: false - t.index ["package_id"], name: "index_packages_package_tags_on_package_id" - end - create_table "packages_packages", force: :cascade do |t| t.integer "project_id", null: false t.datetime_with_timezone "created_at", null: false @@ -2956,6 +2950,15 @@ ActiveRecord::Schema.define(version: 2020_01_06_071113) do t.index ["project_id"], name: "index_packages_packages_on_project_id" end + create_table "packages_tags", force: :cascade do |t| + t.integer "package_id", null: false + t.string "name", limit: 255, null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.index ["package_id", "updated_at"], name: "index_packages_tags_on_package_id_and_updated_at", order: { updated_at: :desc } + t.index ["package_id"], name: "index_packages_tags_on_package_id" + end + create_table "pages_domain_acme_orders", force: :cascade do |t| t.integer "pages_domain_id", null: false t.datetime_with_timezone "expires_at", null: false @@ -4705,8 +4708,8 @@ ActiveRecord::Schema.define(version: 2020_01_06_071113) do add_foreign_key "packages_dependency_links", "packages_packages", column: "package_id", on_delete: :cascade add_foreign_key "packages_maven_metadata", "packages_packages", column: "package_id", name: "fk_be88aed360", on_delete: :cascade add_foreign_key "packages_package_files", "packages_packages", column: "package_id", name: "fk_86f0f182f8", on_delete: :cascade - add_foreign_key "packages_package_tags", "packages_packages", column: "package_id", on_delete: :cascade add_foreign_key "packages_packages", "projects", on_delete: :cascade + add_foreign_key "packages_tags", "packages_packages", column: "package_id", on_delete: :cascade add_foreign_key "pages_domain_acme_orders", "pages_domains", on_delete: :cascade add_foreign_key "pages_domains", "projects", name: "fk_ea2f6dfc6f", on_delete: :cascade add_foreign_key "path_locks", "projects", name: "fk_5265c98f24", on_delete: :cascade |