summaryrefslogtreecommitdiff
path: root/db/migrate/20200731085019_create_experiment.rb
blob: cd326e0958fb6b9cccdc6af65880cb3063d34459 (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
# frozen_string_literal: true

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    unless table_exists?(:experiments)
      create_table :experiments do |t|
        t.text :name, null: false

        t.index :name, unique: true
      end
    end

    add_text_limit :experiments, :name, 255
  end

  def down
    drop_table :experiments
  end
end