Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20200226100614_create_requirements.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4ebbf38b8d114468eecd01c6ef6cb47d5dad2715 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

class CreateRequirements < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  def change
    create_table :requirements do |t|
      t.timestamps_with_timezone null: false
      t.integer :project_id, null: false
      t.integer :author_id
      t.integer :iid, null: false
      t.integer :cached_markdown_version
      t.integer :state, limit: 2, default: 1, null: false
      t.string :title, limit: 255, null: false
      t.text :title_html

      t.index :project_id
      t.index :author_id
      t.index :title, name: "index_requirements_on_title_trigram", using: :gin, opclass: :gin_trgm_ops
      t.index :state
      t.index :created_at
      t.index :updated_at
      t.index %w(project_id iid), name: 'index_requirements_on_project_id_and_iid', where: 'project_id IS NOT NULL', unique: true, using: :btree
    end
  end
end