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

20200922133949_create_bulk_import.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 29d770d13fffacf585ce3ebbd6c8d98c804cc888 (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
# frozen_string_literal: true

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

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :bulk_imports do |t|
        t.references :user, type: :integer, index: true, null: false, foreign_key: { on_delete: :cascade }

        t.integer :source_type, null: false, limit: 2
        t.integer :status, null: false, limit: 2

        t.timestamps_with_timezone
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :bulk_imports
    end
  end
end