class AddFieldsToPrivilege < ActiveRecord::Migration
  def self.up
    add_column :privileges, :description, :text
  end

  def self.down
    remove_column :privileges, :description
  end
end

class AddFieldsToPrivilege < ActiveRecord::Migration
  def self.up
    add_column :privileges, :description, :text
    create_defaults
  end

  def self.down
    remove_column :privileges, :description
  end
  
  def self.create_defaults
    Privilege.reset_column_information
    Privilege.create :name => 'ExaminationControl' , :description => 'Examination Control'
    Privilege.create :name => 'EnterResults' , :description => 'Enter Results'
    Privilege.create :name => 'ViewResults' , :description => 'View Results'
    Privilege.create :name => 'Admission' , :description => 'Admission'
    Privilege.create :name => 'StudentsControl' , :description => 'Students Control'
    Privilege.create :name => 'ManageNews' , :description => 'Manage News'
    Privilege.create :name => 'ManageTimetable' , :description => 'Manage Timetable'
    Privilege.create :name => 'StudentAttendanceView' , :description => 'Student Attendance View'
    Privilege.create :name => 'HrBasics' , :description => 'Hr Basics'
    Privilege.create :name => 'AddNewBatch' , :description => 'Add New Batch'
    Privilege.create :name => 'SubjectMaster' , :description => 'Subject Master'
    Privilege.create :name => 'EventManagement' , :description => 'Event Management'
    Privilege.create :name => 'GeneralSettings' , :description => 'General Settings'
    Privilege.create :name => 'FinanceControl' , :description => 'Finance Control'
    Privilege.create :name => 'TimetableView' , :description => 'Timetable View'
    Privilege.create :name => 'StudentAttendanceRegister' , :description => 'Student Attendance Register'
    Privilege.create :name => 'EmployeeAttendance' , :description => 'Employee Attendance'
    Privilege.create :name => 'PayslipPowers' , :description => 'Payslip Powers'
    Privilege.create :name => 'EmployeeSearch' , :description => 'Employee Search'
    Privilege.create :name => 'SMSManagement' , :description => 'Sms Management'
  end

end

Move create defaults for privillege into migration
Move create defaults for privillege into migration

git-svn-id: 6fb0b63dee43263dbd2534f09c80ea129ca0b2b4@2354 1b8ff446-76f8-11e0-a33c-ba5893e5f458
