Sha256: 5ed38aa3089c53a1cf15bf6bb3d10ada8b51ce292f6920ba2df9e0a34f562013
Contents?: true
Size: 763 Bytes
Versions: 23
Compression:
Stored size: 763 Bytes
Contents
class AddAlchemyRolesToAlchemyUsers < ActiveRecord::Migration[4.2] 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
23 entries across 23 versions & 1 rubygems