Document best practice for moving migrations from EE to CE

The following discussion from !10437 (merged) should be addressed:

  • @ifarkas started a discussion: (+7 comments)

    @abrandl, I tried to implement your suggestion in

    First migration to add all new columns to application_settings (with transactions enabled, add_column, no column_exists? necessary)

    with:

    class MoveExternalClassificationSettingsInApplicationSettingsToCore < ActiveRecord::Migration[5.0]
      DOWNTIME = false
    
      def change
        change_table :application_settings do |t|
          t.boolean :external_authorization_service_enabled, default: false
          t.string :external_authorization_service_url
          t.string :external_authorization_service_default_label
          t.float :external_authorization_service_timeout, default: 0.5
          t.text :external_auth_client_cert
          t.text :encrypted_external_auth_client_key
          t.string :encrypted_external_auth_client_key_iv
          t.string :encrypted_external_auth_client_key_pass
          t.string :encrypted_external_auth_client_key_pass_iv
        end
      end
    end

    But then I am getting

    ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR:  column "external_authorization_service_enabled" of relation "application_settings" already exists

    So it seems those column_exists? checks are necessary anyway. Or am I missing something?

Assignee Loading
Time tracking Loading