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

class EnsureSbomOccurrencesIsEmpty < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  def up
    # Ensure that the sbom_occurrences table is empty to ensure that the
    # following migration adding a not-null column succeeds.
    # The code which creates records in this table has not been implemented yet.
    execute('DELETE FROM sbom_occurrences')
  end

  def down
    # no-op
  end
end