diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 15:09:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-19 15:09:33 +0300 |
commit | 652bd073731b0028641672a75355c7918b5ac116 (patch) | |
tree | e0239f98153492ac89c6fc374c5dfd1aa270d8bf /db/migrate/20200302152516_add_wiki_slug.rb | |
parent | 2af90cef2e2e9c776eae4394a43dba3be7f33d1e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20200302152516_add_wiki_slug.rb')
-rw-r--r-- | db/migrate/20200302152516_add_wiki_slug.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20200302152516_add_wiki_slug.rb b/db/migrate/20200302152516_add_wiki_slug.rb new file mode 100644 index 00000000000..dabac39aeb8 --- /dev/null +++ b/db/migrate/20200302152516_add_wiki_slug.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddWikiSlug < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def change + create_table :wiki_page_meta, id: :serial do |t| + t.references :project, index: true, foreign_key: { on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.string :title, null: false, limit: 255 + end + + create_table :wiki_page_slugs, id: :serial do |t| + t.boolean :canonical, default: false, null: false + t.references :wiki_page_meta, index: true, foreign_key: { on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.string :slug, null: false, limit: 2048 + t.index [:slug, :wiki_page_meta_id], unique: true + t.index [:wiki_page_meta_id], name: 'one_canonical_wiki_page_slug_per_metadata', unique: true, where: "(canonical = true)" + end + end +end |