annotate db/migrate/062_insert_builtin_roles.rb @ 1556:81dd71991dc1 feature_1136

hg-hash option does not appear reliable ("Not updating refs/notes/hg (new tip XXX does not contain YYY")
author Chris Cannam
date Wed, 13 Jan 2016 13:33:03 +0000
parents 433d4f72a19b
children
rev   line source
Chris@0 1 class InsertBuiltinRoles < ActiveRecord::Migration
Chris@0 2 def self.up
Chris@1115 3 Role.reset_column_information
Chris@0 4 nonmember = Role.new(:name => 'Non member', :position => 0)
Chris@0 5 nonmember.builtin = Role::BUILTIN_NON_MEMBER
Chris@0 6 nonmember.save
Chris@909 7
Chris@0 8 anonymous = Role.new(:name => 'Anonymous', :position => 0)
Chris@0 9 anonymous.builtin = Role::BUILTIN_ANONYMOUS
Chris@909 10 anonymous.save
Chris@0 11 end
Chris@0 12
Chris@0 13 def self.down
Chris@0 14 Role.destroy_all 'builtin <> 0'
Chris@0 15 end
Chris@0 16 end