summaryrefslogtreecommitdiff
path: root/db/migrate/20210729081351_create_topics.rb
blob: 13ed2dc7cccd4448ab9d7b56f9a8fbc142486888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

class CreateTopics < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    create_table_with_constraints :topics do |t|
      t.text :name, null: false
      t.text_limit :name, 255

      t.index :name, unique: true

      t.timestamps_with_timezone
    end
  end

  def down
    with_lock_retries do
      drop_table :topics
    end
  end
end