summaryrefslogtreecommitdiff
path: root/db/migrate/20220811092243_create_ml_experiments.rb
blob: a357d62133cbe26e37c96c5f313b19e2ee1dbb1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class CreateMlExperiments < Gitlab::Database::Migration[2.0]
  enable_lock_retries!

  def change
    create_table :ml_experiments do |t|
      t.timestamps_with_timezone null: false
      t.bigint :iid, null: false
      t.bigint :project_id, null: false
      t.references :user, foreign_key: true, index: true, on_delete: :nullify
      t.text :name, limit: 255, null: false

      t.index [:project_id, :iid], unique: true
      t.index [:project_id, :name], unique: true
    end
  end
end