Sha256: 1e7118fc8ed117aa3a04f87af008d3ce37bec957127ef05889b0964afb3b4168

Contents?: true

Size: 509 Bytes

Versions: 12

Compression:

Stored size: 509 Bytes

Contents

class AddTypeToMessagingMessages < ActiveRecord::Migration[5.1]

  def up
    add_column :messaging_messages, :type, :string, null: true
    add_index :messaging_messages, :type
    ActiveRecord::Base.connection.execute(
      "update messaging_messages set type = 'Renalware::Messaging::Internal::Message' where type is null;"
    )
    change_column_null(:messaging_messages, :type, false)
  end

  def down
    remove_index :messaging_messages, :type
    remove_column :messaging_messages, :type
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc8 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc7 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc6 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc5 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc4 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc3 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.rc1 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.beta12 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.beta11 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.beta10 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.beta9 db/migrate/20170911133224_add_type_to_messaging_messages.rb
renalware-core-2.0.0.pre.beta8 db/migrate/20170911133224_add_type_to_messaging_messages.rb