#--
# Copyright 2025 grit42 A/S. <https://grit42.com/>
#
# This file is part of grit-core.
#
# grit-core is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or  any later version.
#
# grit-core is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# grit-core. If not, see <https://www.gnu.org/licenses/>.
#++

[
  { name: 'Afghanistan', iso: 'AF' },
  { name: 'Åland Islands', iso: 'AX' },
  { name: 'Albania', iso: 'AL' },
  { name: 'Algeria', iso: 'DZ' },
  { name: 'American Samoa', iso: 'AS' },
  { name: 'Andorra', iso: 'AD' },
  { name: 'Angola', iso: 'AO' },
  { name: 'Anguilla', iso: 'AI' },
  { name: 'Antarctica', iso: 'AQ' },
  { name: 'Antigua and Barbuda', iso: 'AG' },
  { name: 'Argentina', iso: 'AR' },
  { name: 'Armenia', iso: 'AM' },
  { name: 'Aruba', iso: 'AW' },
  { name: 'Australia', iso: 'AU' },
  { name: 'Austria', iso: 'AT' },
  { name: 'Azerbaijan', iso: 'AZ' },
  { name: 'Bahamas', iso: 'BS' },
  { name: 'Bahrain', iso: 'BH' },
  { name: 'Bangladesh', iso: 'BD' },
  { name: 'Barbados', iso: 'BB' },
  { name: 'Belarus', iso: 'BY' },
  { name: 'Belgium', iso: 'BE' },
  { name: 'Belize', iso: 'BZ' },
  { name: 'Benin', iso: 'BJ' },
  { name: 'Bermuda', iso: 'BM' },
  { name: 'Bhutan', iso: 'BT' },
  { name: 'Bolivia', iso: 'BO' },
  { name: 'Bosnia and Herzegovina', iso: 'BA' },
  { name: 'Botswana', iso: 'BW' },
  { name: 'Bouvet Island', iso: 'BV' },
  { name: 'Brazil', iso: 'BR' },
  { name: 'British Indian Ocean Territory', iso: 'IO' },
  { name: 'Brunei Darussalam', iso: 'BN' },
  { name: 'Bulgaria', iso: 'BG' },
  { name: 'Burkina Faso', iso: 'BF' },
  { name: 'Burundi', iso: 'BI' },
  { name: 'Cambodia', iso: 'KH' },
  { name: 'Cameroon', iso: 'CM' },
  { name: 'Canada', iso: 'CA' },
  { name: 'Cape Verde', iso: 'CV' },
  { name: 'Cayman Islands', iso: 'KY' },
  { name: 'Central African Republic', iso: 'CF' },
  { name: 'Chad', iso: 'TD' },
  { name: 'Chile', iso: 'CL' },
  { name: 'China', iso: 'CN' },
  { name: 'Christmas Island', iso: 'CX' },
  { name: 'Cocos (Keeling) Islands', iso: 'CC' },
  { name: 'Colombia', iso: 'CO' },
  { name: 'Comoros', iso: 'KM' },
  { name: 'Congo', iso: 'CG' },
  { name: 'Congo,:iso =>  The Democratic Republic of The', iso: 'CD' },
  { name: 'Cook Islands', iso: 'CK' },
  { name: 'Costa Rica', iso: 'CR' },
  { name: 'Cote D''ivoire', iso: 'CI' },
  { name: 'Croatia', iso: 'HR' },
  { name: 'Cuba', iso: 'CU' },
  { name: 'Cyprus', iso: 'CY' },
  { name: 'Czech Republic', iso: 'CZ' },
  { name: 'Denmark', iso: 'DK' },
  { name: 'Djibouti', iso: 'DJ' },
  { name: 'Dominica', iso: 'DM' },
  { name: 'Dominican Republic', iso: 'DO' },
  { name: 'Ecuador', iso: 'EC' },
  { name: 'Egypt', iso: 'EG' },
  { name: 'El Salvador', iso: 'SV' },
  { name: 'Equatorial Guinea', iso: 'GQ' },
  { name: 'Eritrea', iso: 'ER' },
  { name: 'Estonia', iso: 'EE' },
  { name: 'Ethiopia', iso: 'ET' },
  { name: 'Falkland Islands (Malvinas)', iso: 'FK' },
  { name: 'Faroe Islands', iso: 'FO' },
  { name: 'Fiji', iso: 'FJ' },
  { name: 'Finland', iso: 'FI' },
  { name: 'France', iso: 'FR' },
  { name: 'French Guiana', iso: 'GF' },
  { name: 'French Polynesia', iso: 'PF' },
  { name: 'French Southern Territories', iso: 'TF' },
  { name: 'Gabon', iso: 'GA' },
  { name: 'Gambia', iso: 'GM' },
  { name: 'Georgia', iso: 'GE' },
  { name: 'Germany', iso: 'DE' },
  { name: 'Ghana', iso: 'GH' },
  { name: 'Gibraltar', iso: 'GI' },
  { name: 'Greece', iso: 'GR' },
  { name: 'Greenland', iso: 'GL' },
  { name: 'Grenada', iso: 'GD' },
  { name: 'Guadeloupe', iso: 'GP' },
  { name: 'Guam', iso: 'GU' },
  { name: 'Guatemala', iso: 'GT' },
  { name: 'Guernsey', iso: 'GG' },
  { name: 'Guinea', iso: 'GN' },
  { name: 'Guinea-bissau', iso: 'GW' },
  { name: 'Guyana', iso: 'GY' },
  { name: 'Haiti', iso: 'HT' },
  { name: 'Heard Island and Mcdonald Islands', iso: 'HM' },
  { name: 'Holy See (Vatican City State)', iso: 'VA' },
  { name: 'Honduras', iso: 'HN' },
  { name: 'Hong Kong', iso: 'HK' },
  { name: 'Hungary', iso: 'HU' },
  { name: 'Iceland', iso: 'IS' },
  { name: 'India', iso: 'IN' },
  { name: 'Indonesia', iso: 'ID' },
  { name: 'Iran,:iso =>  Islamic Republic of', iso: 'IR' },
  { name: 'Iraq', iso: 'IQ' },
  { name: 'Ireland', iso: 'IE' },
  { name: 'Isle of Man', iso: 'IM' },
  { name: 'Israel', iso: 'IL' },
  { name: 'Italy', iso: 'IT' },
  { name: 'Jamaica', iso: 'JM' },
  { name: 'Japan', iso: 'JP' },
  { name: 'Jersey', iso: 'JE' },
  { name: 'Jordan', iso: 'JO' },
  { name: 'Kazakhstan', iso: 'KZ' },
  { name: 'Kenya', iso: 'KE' },
  { name: 'Kiribati', iso: 'KI' },
  { name: 'Korea,:iso =>  Democratic People''s Republic of', iso: 'KP' },
  { name: 'Korea,:iso =>  Republic of', iso: 'KR' },
  { name: 'Kuwait', iso: 'KW' },
  { name: 'Kyrgyzstan', iso: 'KG' },
  { name: 'Lao People''s Democratic Republic', iso: 'LA' },
  { name: 'Latvia', iso: 'LV' },
  { name: 'Lebanon', iso: 'LB' },
  { name: 'Lesotho', iso: 'LS' },
  { name: 'Liberia', iso: 'LR' },
  { name: 'Libyan Arab Jamahiriya', iso: 'LY' },
  { name: 'Liechtenstein', iso: 'LI' },
  { name: 'Lithuania', iso: 'LT' },
  { name: 'Luxembourg', iso: 'LU' },
  { name: 'Macao', iso: 'MO' },
  { name: 'Macedonia,:iso =>  The Former Yugoslav Republic of', iso: 'MK' },
  { name: 'Madagascar', iso: 'MG' },
  { name: 'Malawi', iso: 'MW' },
  { name: 'Malaysia', iso: 'MY' },
  { name: 'Maldives', iso: 'MV' },
  { name: 'Mali', iso: 'ML' },
  { name: 'Malta', iso: 'MT' },
  { name: 'Marshall Islands', iso: 'MH' },
  { name: 'Martinique', iso: 'MQ' },
  { name: 'Mauritania', iso: 'MR' },
  { name: 'Mauritius', iso: 'MU' },
  { name: 'Mayotte', iso: 'YT' },
  { name: 'Mexico', iso: 'MX' },
  { name: 'Micronesia,:iso =>  Federated States of', iso: 'FM' },
  { name: 'Moldova,:iso =>  Republic of', iso: 'MD' },
  { name: 'Monaco', iso: 'MC' },
  { name: 'Mongolia', iso: 'MN' },
  { name: 'Montenegro', iso: 'ME' },
  { name: 'Montserrat', iso: 'MS' },
  { name: 'Morocco', iso: 'MA' },
  { name: 'Mozambique', iso: 'MZ' },
  { name: 'Myanmar', iso: 'MM' },
  { name: 'Namibia', iso: 'NA' },
  { name: 'Nauru', iso: 'NR' },
  { name: 'Nepal', iso: 'NP' },
  { name: 'Netherlands', iso: 'NL' },
  { name: 'Netherlands Antilles', iso: 'AN' },
  { name: 'New Caledonia', iso: 'NC' },
  { name: 'New Zealand', iso: 'NZ' },
  { name: 'Nicaragua', iso: 'NI' },
  { name: 'Niger', iso: 'NE' },
  { name: 'Nigeria', iso: 'NG' },
  { name: 'Niue', iso: 'NU' },
  { name: 'Norfolk Island', iso: 'NF' },
  { name: 'Northern Mariana Islands', iso: 'MP' },
  { name: 'Norway', iso: 'NO' },
  { name: 'Oman', iso: 'OM' },
  { name: 'Pakistan', iso: 'PK' },
  { name: 'Palau', iso: 'PW' },
  { name: 'Palestinian Territory,:iso =>  Occupied', iso: 'PS' },
  { name: 'Panama', iso: 'PA' },
  { name: 'Papua New Guinea', iso: 'PG' },
  { name: 'Paraguay', iso: 'PY' },
  { name: 'Peru', iso: 'PE' },
  { name: 'Philippines', iso: 'PH' },
  { name: 'Pitcairn', iso: 'PN' },
  { name: 'Poland', iso: 'PL' },
  { name: 'Portugal', iso: 'PT' },
  { name: 'Puerto Rico', iso: 'PR' },
  { name: 'Qatar', iso: 'QA' },
  { name: 'Reunion', iso: 'RE' },
  { name: 'Romania', iso: 'RO' },
  { name: 'Russian Federation', iso: 'RU' },
  { name: 'Rwanda', iso: 'RW' },
  { name: 'Saint Helena', iso: 'SH' },
  { name: 'Saint Kitts and Nevis', iso: 'KN' },
  { name: 'Saint Lucia', iso: 'LC' },
  { name: 'Saint Pierre and Miquelon', iso: 'PM' },
  { name: 'Saint Vincent and The Grenadines', iso: 'VC' },
  { name: 'Samoa', iso: 'WS' },
  { name: 'San Marino', iso: 'SM' },
  { name: 'Sao Tome and Principe', iso: 'ST' },
  { name: 'Saudi Arabia', iso: 'SA' },
  { name: 'Senegal', iso: 'SN' },
  { name: 'Serbia', iso: 'RS' },
  { name: 'Seychelles', iso: 'SC' },
  { name: 'Sierra Leone', iso: 'SL' },
  { name: 'Singapore', iso: 'SG' },
  { name: 'Slovakia', iso: 'SK' },
  { name: 'Slovenia', iso: 'SI' },
  { name: 'Solomon Islands', iso: 'SB' },
  { name: 'Somalia', iso: 'SO' },
  { name: 'South Africa', iso: 'ZA' },
  { name: 'South Georgia and The South Sandwich Islands', iso: 'GS' },
  { name: 'Spain', iso: 'ES' },
  { name: 'Sri Lanka', iso: 'LK' },
  { name: 'Sudan', iso: 'SD' },
  { name: 'Suriname', iso: 'SR' },
  { name: 'Svalbard and Jan Mayen', iso: 'SJ' },
  { name: 'Swaziland', iso: 'SZ' },
  { name: 'Sweden', iso: 'SE' },
  { name: 'Switzerland', iso: 'CH' },
  { name: 'Syrian Arab Republic', iso: 'SY' },
  { name: 'Taiwan,:iso =>  Province of China', iso: 'TW' },
  { name: 'Tajikistan', iso: 'TJ' },
  { name: 'Tanzania,:iso =>  United Republic of', iso: 'TZ' },
  { name: 'Thailand', iso: 'TH' },
  { name: 'Timor-leste', iso: 'TL' },
  { name: 'Togo', iso: 'TG' },
  { name: 'Tokelau', iso: 'TK' },
  { name: 'Tonga', iso: 'TO' },
  { name: 'Trinidad and Tobago', iso: 'TT' },
  { name: 'Tunisia', iso: 'TN' },
  { name: 'Turkey', iso: 'TR' },
  { name: 'Turkmenistan', iso: 'TM' },
  { name: 'Turks and Caicos Islands', iso: 'TC' },
  { name: 'Tuvalu', iso: 'TV' },
  { name: 'Uganda', iso: 'UG' },
  { name: 'Ukraine', iso: 'UA' },
  { name: 'United Arab Emirates', iso: 'AE' },
  { name: 'United Kingdom', iso: 'GB' },
  { name: 'United States', iso: 'US' },
  { name: 'United States Minor Outlying Islands', iso: 'UM' },
  { name: 'Uruguay', iso: 'UY' },
  { name: 'Uzbekistan', iso: 'UZ' },
  { name: 'Vanuatu', iso: 'VU' },
  { name: 'Venezuela', iso: 'VE' },
  { name: 'Viet Nam', iso: 'VN' },
  { name: 'Virgin Islands,:iso =>  British', iso: 'VG' },
  { name: 'Virgin Islands,:iso =>  U.S.', iso: 'VI' },
  { name: 'Wallis and Futuna', iso: 'WF' },
  { name: 'Western Sahara', iso: 'EH' },
  { name: 'Yemen', iso: 'YE' },
  { name: 'Zambia', iso: 'ZM' },
  { name: 'Zimbabwe', iso: 'ZW' }
].each do |country|
  Grit::Core::Country.insert(country) if Grit::Core::Country.find_by(iso: country[:iso]).nil?
end

Grit::Core::Origin.insert({ id: 1, name: "ADMIN" }) if Grit::Core::Origin.find_by(name: "ADMIN").nil?

Grit::Core::Role.insert({ id: 1, name: "Administrator", description: "Platform administrator" }) if Grit::Core::Role.find_by(name: "Administrator").nil?

Grit::Core::User.insert({
  id: 1,
  origin_id: 1,
  login: "admin",
  name: "Administrator",
  active: false,
  email: ENV.fetch("GRIT_CORE_ADMIN_EMAIL", "email@example.com"),
  activation_token: "admin"
}) if Grit::Core::User.find_by(login: "admin").nil?

Grit::Core::UserRole.insert({ user_id: 1, role_id: 1 }) if Grit::Core::UserRole.find_by(user_id: 1, role_id: 1).nil?

Grit::Core::LoadSetStatus.insert({ name: 'Mapping', description: 'The columns must be mapped to attributes' }) if Grit::Core::LoadSetStatus.find_by(name: 'Mapping').nil?
Grit::Core::LoadSetStatus.insert({ name: 'Mapped', description: 'The columns have been mapped to attributes and the dataset must be validated' }) if Grit::Core::LoadSetStatus.find_by(name: 'Mapped').nil?
Grit::Core::LoadSetStatus.insert({ name: 'Validating', description: 'The dataset is being validated' }) if Grit::Core::LoadSetStatus.find_by(name: 'Validating').nil?
Grit::Core::LoadSetStatus.insert({ name: 'Validated', description: 'The dataset has been validated and the import can be confirmed' }) if Grit::Core::LoadSetStatus.find_by(name: 'Validated').nil?
Grit::Core::LoadSetStatus.insert({ name: 'Invalidated', description: 'The dataset has not been validated, mappings must be changed or the upload cancelled' }) if Grit::Core::LoadSetStatus.find_by(name: 'Invalidated').nil?
Grit::Core::LoadSetStatus.insert({ name: 'Succeeded', description: 'The upload succeded' }) if Grit::Core::LoadSetStatus.find_by(name: 'Succeeded').nil?

Grit::Core::DataType.upsert({ name: "string", description: "Best for short text. Displayed as a single line input" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "text", description: "Best for longer text. Displayed as a multiline input" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "integer", description: "Prefer over decimal when the values are always integer number" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "decimal", description: "Exact decimal numbers" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "date", description: "Prefer over datetime when only the date is relevant" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "datetime", description: "Date and time"  }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "boolean", description: "Boolean values, Displayed as a switch" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "Grit::Core::Origin", description: "Origin", is_entity: true, table_name: "grit_core_origins" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "Grit::Core::Location", description: "Location", is_entity: true, table_name: "grit_core_locations" }, unique_by: :name)
Grit::Core::DataType.upsert({ name: "Grit::Core::Country", description: "Country", is_entity: true, table_name: "grit_core_countries" }, unique_by: :name)

Grit::Core::Unit.insert({ unit_type: 'volume', name: 'millilitre', abbreviation: 'ml', si_unit: '1.0e-6 m^3' }) if Grit::Core::Unit.find_by(name: 'millilitre').nil?
Grit::Core::Unit.insert({ unit_type: 'mass', name: 'gram', abbreviation: 'g', si_unit: '10^-3 kg' }) if Grit::Core::Unit.find_by(name: 'gram').nil?
Grit::Core::Unit.insert({ unit_type: 'mass', name: 'kilogram', abbreviation: 'kg', si_unit: 'kg' }) if Grit::Core::Unit.find_by(name: 'kilogram').nil?
Grit::Core::Unit.insert({ unit_type: 'time', name: 'second', abbreviation: 's', si_unit: 's' }) if Grit::Core::Unit.find_by(name: 'second').nil?
Grit::Core::Unit.insert({ unit_type: 'electric current', name: 'ampere', abbreviation: 'A', si_unit: 'A' }) if Grit::Core::Unit.find_by(name: 'ampere').nil?
Grit::Core::Unit.insert({ unit_type: 'thermodynamic temperature', name: 'kelvin', abbreviation: 'K', si_unit: 'K' }) if Grit::Core::Unit.find_by(name: 'kelvin').nil?
Grit::Core::Unit.insert({ unit_type: 'amount of substance', name: 'mole', abbreviation: 'mol', si_unit: 'mol' }) if Grit::Core::Unit.find_by(name: 'mole').nil?
Grit::Core::Unit.insert({ unit_type: 'luminous intensity', name: 'candela', abbreviation: 'cd', si_unit: 'cd' }) if Grit::Core::Unit.find_by(name: 'candela').nil?
Grit::Core::Unit.insert({ unit_type: 'volume', name: 'microlitre', abbreviation: 'µl', si_unit: '1.0e-9 m^3' }) if Grit::Core::Unit.find_by(name: 'microlitre').nil?
Grit::Core::Unit.insert({ unit_type: 'volume', name: 'litre', abbreviation: 'l', si_unit: '1.0e-3 m^3' }) if Grit::Core::Unit.find_by(name: 'litre').nil?
Grit::Core::Unit.insert({ unit_type: 'ratio', name: 'percent', abbreviation: '%', si_unit: '-' }) if Grit::Core::Unit.find_by(name: 'percent').nil?
Grit::Core::Unit.insert({ unit_type: 'length', name: 'meter', abbreviation: 'm', si_unit: 'm' }) if Grit::Core::Unit.find_by(name: 'meter').nil?
Grit::Core::Unit.insert({ unit_type: 'molar', name: 'Milli molar', abbreviation: 'mM', si_unit: 'mM' }) if Grit::Core::Unit.find_by(name: 'Milli molar').nil?
Grit::Core::Unit.insert({ unit_type: 'molar', name: 'Nano molar', abbreviation: 'nM', si_unit: 'nM' }) if Grit::Core::Unit.find_by(name: 'Nano molar').nil?
Grit::Core::Unit.insert({ unit_type: 'time', name: 'week', abbreviation: 'week', si_unit: '604800 s' }) if Grit::Core::Unit.find_by(name: 'week').nil?
Grit::Core::Unit.insert({ unit_type: 'mass', name: 'milligram', abbreviation: 'mg', si_unit: '10^-6 kg' }) if Grit::Core::Unit.find_by(name: 'milligram').nil?
Grit::Core::Unit.insert({ unit_type: 'time', name: 'hour', abbreviation: 'h', si_unit: '3600 s' }) if Grit::Core::Unit.find_by(name: 'hour').nil?
Grit::Core::Unit.insert({ unit_type: 'cfu', name: 'CFU/ml', abbreviation: 'CFU/ml', si_unit: 'ml' }) if Grit::Core::Unit.find_by(name: 'CFU/ml').nil?
Grit::Core::Unit.insert({ unit_type: 'cfu', name: 'CFU', abbreviation: 'CFU', si_unit: '' }) if Grit::Core::Unit.find_by(name: 'CFU').nil?
Grit::Core::Unit.insert({ unit_type: 'molar', name: 'Micro molar', abbreviation: 'μM', si_unit: 'μM' }) if Grit::Core::Unit.find_by(name: 'Micro molar').nil?
Grit::Core::Unit.insert({ unit_type: 'concentration', name: 'Milligram per litre', abbreviation: 'mg/l', si_unit: 'mg/l' }) if Grit::Core::Unit.find_by(name: 'Milligram per litre').nil?
Grit::Core::Unit.insert({ unit_type: 'concentration', name: 'Microgram per millilitre', abbreviation: 'μg/ml', si_unit: 'μg/ml' }) if Grit::Core::Unit.find_by(name: 'Microgram per millilitre').nil?
Grit::Core::Unit.insert({ unit_type: 'mass', name: 'microgram', abbreviation: 'μg', si_unit: '10^-6 g' }) if Grit::Core::Unit.find_by(name: 'microgram').nil?
Grit::Core::Unit.insert({ unit_type: 'length', name: 'milimeter', abbreviation: 'mm', si_unit: '10^-3 m' }) if Grit::Core::Unit.find_by(name: 'milimeter').nil?
Grit::Core::Unit.insert({ unit_type: 'time', name: 'minute', abbreviation: 'min', si_unit: '60 s' }) if Grit::Core::Unit.find_by(name: 'minute').nil?
Grit::Core::Unit.insert({ unit_type: 'flow dynamics', name: 'milliliter per min per kilo', abbreviation: 'mL/min/kg', si_unit: '10^-1/6 L*g/s' }) if Grit::Core::Unit.find_by(name: 'milliliter per min per kilo').nil?
Grit::Core::Unit.insert({ unit_type: 'concentration', name: 'million cells per milliliter', abbreviation: 'mill cells/mL', si_unit: '10^9 cells/L' }) if Grit::Core::Unit.find_by(name: 'million cells per milliliter').nil?
Grit::Core::Unit.insert({ unit_type: 'concentration', name: 'gram per kilo', abbreviation: 'g/kg', si_unit: '' }) if Grit::Core::Unit.find_by(name: 'gram per kilo').nil?
Grit::Core::Unit.insert({ unit_type: 'concentration', name: 'million cells per gram', abbreviation: 'mill cells/g', si_unit: '10^6 cells/g' }) if Grit::Core::Unit.find_by(name: 'million cells per gram').nil?
Grit::Core::Unit.insert({ unit_type: 'flow dynamics', name: 'milliliter per minute per milligram', abbreviation: 'mL/min/mg', si_unit: '5/3 L*g/s' }) if Grit::Core::Unit.find_by(name: 'milliliter per minute per milligram').nil?

Grit::Core::PublicationStatus.insert({ name: "Draft", description: "Actively worked on" }) if Grit::Core::PublicationStatus.find_by(name: "Draft").nil?
Grit::Core::PublicationStatus.insert({ name: "Published", description: "Available for use" }) if Grit::Core::PublicationStatus.find_by(name: "Published").nil?
Grit::Core::PublicationStatus.insert({ name: "Withdrawn", description: "Should not be used anymore" }) if Grit::Core::PublicationStatus.find_by(name: "Withdrawn").nil?

Grit::Core::Role.upsert({ name: "VocabularyAdministrator", description: "Can create and modify controlled vocabularies" }) if Grit::Core::Role.find_by(name: "VocabularyAdministrator").nil?
