Sha256: 59fbbc7fcb9d3a41b614df582b033521d3f5fe387f2cc8c470e669e10fb81230

Contents?: true

Size: 573 Bytes

Versions: 22

Compression:

Stored size: 573 Bytes

Contents

# frozen_string_literal: true

class AddNotificationTypesToUsers < ActiveRecord::Migration[5.2]
  class UserBaseEntity < ApplicationRecord
    self.table_name = :decidim_users
    self.inheritance_column = nil # disable the default inheritance
  end

  def change
    add_column :decidim_users, :notification_types, :string, default: "all"
    # rubocop:disable Rails/SkipsModelValidations
    UserBaseEntity.update_all(notification_types: "all")
    # rubocop:enable Rails/SkipsModelValidations

    change_column_null :decidim_users, :notification_types, false
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
decidim-core-0.29.1 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.4 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.27.9 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.29.0 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.3 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.27.8 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.29.0.rc4 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.29.0.rc3 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.29.0.rc2 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.29.0.rc1 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.2 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.27.7 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.1 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.27.6 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.26.10 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.26.9 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.0 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.27.5 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.0.rc5 db/migrate/20181214101250_add_notification_types_to_users.rb
decidim-core-0.28.0.rc4 db/migrate/20181214101250_add_notification_types_to_users.rb