class AddGenericSamlToProviderServiceEnum
Public Instance Methods
down()
click to toggle source
# File lib/osso/db/migrate/20210201220556_add_generic_saml_to_provider_service_enum.rb, line 10 def down execute <<~SQL CREATE TYPE identity_provider_service_new AS ENUM ('AZURE', 'OKTA', 'ONELOGIN', 'GOOGLE', 'PING', 'SALESFORCE'); -- Remove values that won't be compatible with new definition DELETE FROM identity_providers WHERE service = 'OTHER'; -- Convert to new type, casting via text representation ALTER TABLE identity_providers ALTER COLUMN service TYPE identity_provider_service_new USING (service::text::identity_provider_service_new); -- and swap the types DROP TYPE identity_provider_service; ALTER TYPE identity_provider_service_new RENAME TO identity_provider_service; SQL end
up()
click to toggle source
# File lib/osso/db/migrate/20210201220556_add_generic_saml_to_provider_service_enum.rb, line 4 def up execute <<-SQL ALTER TYPE identity_provider_service ADD VALUE 'OTHER'; SQL end