Module: DataClassification::Migration

Included in:
CreateGenerator
Defined in:
lib/data_classification/migration.rb

Instance Method Summary collapse

Instance Method Details

#add_data_classification(table, column, classification) ⇒ Object



5
6
7
# File 'lib/data_classification/migration.rb', line 5

def add_data_classification(table, column, classification)
  change_column_comment table, column, data_classification_comment(classification)
end

#data_classification_comment(classification) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/data_classification/migration.rb', line 9

def data_classification_comment(classification)
  fail "This is not a valid data classification" unless DATA_CLASSIFICATIONS.include? classification

  {
    tags: [
      "classification:#{classification}",
    ],
  }.to_json
end