Sha256: fd4e3fb79058010404e17957d4b91fa40327dd8f69f5bf9c016aa6e23bbd9968
Contents?: true
Size: 758 Bytes
Versions: 13
Compression:
Stored size: 758 Bytes
Contents
class AddAlchemyRolesToAlchemyUsers < ActiveRecord::Migration def up # Updating old :roles column (since Alchemy CMS v2.6) if column_exists?(:alchemy_users, :roles) rename_column :alchemy_users, :roles, :alchemy_roles change_column :alchemy_users, :alchemy_roles, :string, default: "member" end # Creating :alchemy_roles column for new apps. unless column_exists?(:alchemy_users, :alchemy_roles) add_column :alchemy_users, :alchemy_roles, :string, default: "member" end # Renaming the index if index_exists?(:alchemy_users, :roles) remove_index :alchemy_users, :roles end unless index_exists?(:alchemy_users, :alchemy_roles) add_index :alchemy_users, :alchemy_roles end end end
Version data entries
13 entries across 10 versions & 1 rubygems