summaryrefslogtreecommitdiff
path: root/db/migrate/20201230180202_create_onboarding_progress.rb
blob: b9fe64eb19db94821dd96da51c7351272abf03ab (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
29
30
31
32
33
34
35
36
# frozen_string_literal: true

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

  DOWNTIME = false

  def up
    with_lock_retries do
      create_table :onboarding_progresses do |t|
        t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
        t.timestamps_with_timezone null: false
        t.datetime_with_timezone :git_pull_at
        t.datetime_with_timezone :git_write_at
        t.datetime_with_timezone :merge_request_created_at
        t.datetime_with_timezone :pipeline_created_at
        t.datetime_with_timezone :user_added_at
        t.datetime_with_timezone :trial_started_at
        t.datetime_with_timezone :subscription_created_at
        t.datetime_with_timezone :required_mr_approvals_enabled_at
        t.datetime_with_timezone :code_owners_enabled_at
        t.datetime_with_timezone :scoped_label_created_at
        t.datetime_with_timezone :security_scan_enabled_at
        t.datetime_with_timezone :issue_auto_closed_at
        t.datetime_with_timezone :repository_imported_at
        t.datetime_with_timezone :repository_mirrored_at
      end
    end
  end

  def down
    with_lock_retries do
      drop_table :onboarding_progresses
    end
  end
end