1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-12 04:03:08 +00:00

added migrations for queries

git-svn-id: http://redmine.rubyforge.org/svn/branches/work@88 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-12-16 10:58:36 +00:00
parent c524fd0423
commit e31070f21c
3 changed files with 25 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class Permission < ActiveRecord::Base
200 => :label_member_plural,
300 => :label_version_plural,
400 => :label_issue_category_plural,
600 => :label_query_plural,
1000 => :label_issue_plural,
1100 => :label_news_plural,
1200 => :label_document_plural,

View File

@ -0,0 +1,15 @@
class CreateQueries < ActiveRecord::Migration
def self.up
create_table :queries, :force => true do |t|
t.column "project_id", :integer
t.column "name", :string, :default => "", :null => false
t.column "filters", :text
t.column "user_id", :integer, :default => 0, :null => false
t.column "is_public", :boolean, :default => false, :null => false
end
end
def self.down
drop_table :queries
end
end

View File

@ -0,0 +1,9 @@
class AddQueriesPermissions < ActiveRecord::Migration
def self.up
Permission.create :controller => "projects", :action => "add_query", :description => "button_create", :sort => 600, :is_public => false, :mail_option => 0, :mail_enabled => 0
end
def self.down
Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'add_query']).destroy
end
end