Sha256: 0ffd0dd7edd35c32be3014b6d3a0bb5308d808308b0a2d8d581d8f780b7eadac

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

class UpdateOrganizationMetadata < ActiveRecord::Migration
  def change
    add_column :organizations, :push_disabled, :boolean
    add_column :organizations, :pull_disabled, :boolean
    change_column :organizations, :synchronized_entities, :text

    # Migration to update the way we handle synchronized_entities for data sharing.
    # Before : synchronized_entities = {company: true}
    # After: synchronized_entities = {company: {can_push_to_connec: true, can_push_to_external: true}}

    #We also add metadata from MnoHub
    Maestrano::Connector::Rails::Organization.all.each do |o|
      o.set_instance_metadata
      o.reset_synchronized_entities
      o.enable_historical_data(true) if o.push_disabled
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.2.pre.RC4 db/migrate/20170202033323_update_organization_metadata.rb
maestrano-connector-rails-2.0.2.pre.RC3 db/migrate/20170202033323_update_organization_metadata.rb