Sha256: 1d59b177fcf862ccd94114f985d0e7a9b9b743f15eb7510e36b2a393c022d578

Contents?: true

Size: 750 Bytes

Versions: 74

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

class AddRolesToMemberships < ActiveRecord::Migration[5.2]
  def up
    add_column :decidim_user_group_memberships, :role, :string, default: "requested"
    execute("UPDATE decidim_user_group_memberships SET role = 'creator'")
    change_column_null :decidim_user_group_memberships, :role, false
    add_index(
      :decidim_user_group_memberships,
      %w(role decidim_user_group_id),
      where: "(role = 'creator')",
      name: "decidim_group_membership_one_creator_per_group",
      unique: true
    )
  end

  def down
    remove_column :decidim_user_group_memberships, :role
    remove_index(
      :decidim_user_group_memberships,
      name: "decidim_group_membership_one_creator_per_group"
    )
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

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