##// END OF EJS Templates
SQL error using PostgreSQL...
Jean-Philippe Lang -
r3:b1ede59d0289
parent child
Show More
@@ -0,0 +1,18
1 <?xml version="1.0" encoding="UTF-8"?>
2 <projectDescription>
3 <name>redmine</name>
4 <comment></comment>
5 <projects>
6 </projects>
7 <buildSpec>
8 <buildCommand>
9 <name>org.rubypeople.rdt.core.rubybuilder</name>
10 <arguments>
11 </arguments>
12 </buildCommand>
13 </buildSpec>
14 <natures>
15 <nature>org.radrails.rails.ui.railsnature</nature>
16 <nature>org.rubypeople.rdt.core.rubynature</nature>
17 </natures>
18 </projectDescription>
@@ -0,0 +1,19
1 # Settings specified here will take precedence over those in config/environment.rb
2
3 # In the development environment your application's code is reloaded on
4 # every request. This slows down response time but is perfect for development
5 # since you don't have to restart the webserver when you make code changes.
6 config.cache_classes = false
7
8 # Log error messages when you accidentally call methods on nil.
9 config.whiny_nils = true
10
11 # Enable the breakpoint server that script/breakpointer connects to
12 config.breakpoint_server = true
13
14 # Show full error reports and disable caching
15 config.action_controller.consider_all_requests_local = true
16 config.action_controller.perform_caching = false
17
18 # Don't care if the mailer can't send
19 config.action_mailer.raise_delivery_errors = false
@@ -1,71 +1,71
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class ReportsController < ApplicationController
18 class ReportsController < ApplicationController
19 layout 'base'
19 layout 'base'
20 before_filter :find_project, :authorize
20 before_filter :find_project, :authorize
21
21
22 def issue_report
22 def issue_report
23 @statuses = IssueStatus.find_all
23 @statuses = IssueStatus.find_all
24 @trackers = Tracker.find_all
24 @trackers = Tracker.find_all
25 @issues_by_tracker =
25 @issues_by_tracker =
26 ActiveRecord::Base.connection.select_all("select s.id as status_id,
26 ActiveRecord::Base.connection.select_all("select s.id as status_id,
27 s.is_closed as closed,
27 s.is_closed as closed,
28 t.id as tracker_id,
28 t.id as tracker_id,
29 count(i.id) as total
29 count(i.id) as total
30 from
30 from
31 issues i, issue_statuses s, trackers t
31 issues i, issue_statuses s, trackers t
32 where
32 where
33 i.status_id=s.id
33 i.status_id=s.id
34 and i.tracker_id=t.id
34 and i.tracker_id=t.id
35 and i.project_id=#{@project.id}
35 and i.project_id=#{@project.id}
36 group by s.id, t.id")
36 group by s.id, s.is_closed, t.id")
37 @priorities = Enumeration::get_values('IPRI')
37 @priorities = Enumeration::get_values('IPRI')
38 @issues_by_priority =
38 @issues_by_priority =
39 ActiveRecord::Base.connection.select_all("select s.id as status_id,
39 ActiveRecord::Base.connection.select_all("select s.id as status_id,
40 s.is_closed as closed,
40 s.is_closed as closed,
41 p.id as priority_id,
41 p.id as priority_id,
42 count(i.id) as total
42 count(i.id) as total
43 from
43 from
44 issues i, issue_statuses s, enumerations p
44 issues i, issue_statuses s, enumerations p
45 where
45 where
46 i.status_id=s.id
46 i.status_id=s.id
47 and i.priority_id=p.id
47 and i.priority_id=p.id
48 and i.project_id=#{@project.id}
48 and i.project_id=#{@project.id}
49 group by s.id, p.id")
49 group by s.id, s.is_closed, p.id")
50 @categories = @project.issue_categories
50 @categories = @project.issue_categories
51 @issues_by_category =
51 @issues_by_category =
52 ActiveRecord::Base.connection.select_all("select s.id as status_id,
52 ActiveRecord::Base.connection.select_all("select s.id as status_id,
53 s.is_closed as closed,
53 s.is_closed as closed,
54 c.id as category_id,
54 c.id as category_id,
55 count(i.id) as total
55 count(i.id) as total
56 from
56 from
57 issues i, issue_statuses s, issue_categories c
57 issues i, issue_statuses s, issue_categories c
58 where
58 where
59 i.status_id=s.id
59 i.status_id=s.id
60 and i.category_id=c.id
60 and i.category_id=c.id
61 and i.project_id=#{@project.id}
61 and i.project_id=#{@project.id}
62 group by s.id, c.id")
62 group by s.id, s.is_closed, c.id")
63 end
63 end
64
64
65
65
66 private
66 private
67 # Find project of id params[:id]
67 # Find project of id params[:id]
68 def find_project
68 def find_project
69 @project = Project.find(params[:id])
69 @project = Project.find(params[:id])
70 end
70 end
71 end
71 end
@@ -1,32 +1,39
1 # MySQL (default setup). Versions 4.1 and 5.0 are recommended.
1 # MySQL (default setup). Versions 4.1 and 5.0 are recommended.
2 #
2 #
3 # Get the fast C bindings:
3 # Get the fast C bindings:
4 # gem install mysql
4 # gem install mysql
5 # (on OS X: gem install mysql -- --include=/usr/local/lib)
5 # (on OS X: gem install mysql -- --include=/usr/local/lib)
6 # And be sure to use new-style password hashing:
6 # And be sure to use new-style password hashing:
7 # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
7 # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
8 development:
8 development:
9 adapter: mysql
9 adapter: mysql
10 database: redmine_development
10 database: redmine_development
11 host: localhost
11 host: localhost
12 username: root
12 username: root
13 password:
13 password:
14
15 development_pgsql:
16 adapter: postgresql
17 database: redmine
18 host: localhost
19 username: postgres
20 password: "postgres"
14
21
15 test:
22 test:
16 adapter: mysql
23 adapter: mysql
17 database: redmine_test
24 database: redmine_test
18 host: localhost
25 host: localhost
19 username: root
26 username: root
20 password:
27 password:
21
28
22 demo:
29 demo:
23 adapter: sqlite3
30 adapter: sqlite3
24 dbfile: db/redmine_demo.db
31 dbfile: db/redmine_demo.db
25
32
26 production:
33 production:
27 adapter: mysql
34 adapter: mysql
28 database: redmine
35 database: redmine
29 host: localhost
36 host: localhost
30 username: root
37 username: root
31 password:
38 password:
32 No newline at end of file
39
@@ -1,254 +1,254
1 class Setup < ActiveRecord::Migration
1 class Setup < ActiveRecord::Migration
2 def self.up
2 def self.up
3 create_table "attachments", :force => true do |t|
3 create_table "attachments", :force => true do |t|
4 t.column "container_id", :integer, :default => 0, :null => false
4 t.column "container_id", :integer, :default => 0, :null => false
5 t.column "container_type", :string, :limit => 30, :default => "", :null => false
5 t.column "container_type", :string, :limit => 30, :default => "", :null => false
6 t.column "filename", :string, :default => "", :null => false
6 t.column "filename", :string, :default => "", :null => false
7 t.column "disk_filename", :string, :default => "", :null => false
7 t.column "disk_filename", :string, :default => "", :null => false
8 t.column "size", :integer, :default => 0, :null => false
8 t.column "size", :integer, :default => 0, :null => false
9 t.column "content_type", :string, :limit => 60, :default => "", :null => false
9 t.column "content_type", :string, :limit => 60, :default => "", :null => false
10 t.column "digest", :string, :limit => 40, :default => "", :null => false
10 t.column "digest", :string, :limit => 40, :default => "", :null => false
11 t.column "downloads", :integer, :default => 0, :null => false
11 t.column "downloads", :integer, :default => 0, :null => false
12 t.column "author_id", :integer, :default => 0, :null => false
12 t.column "author_id", :integer, :default => 0, :null => false
13 t.column "created_on", :timestamp
13 t.column "created_on", :timestamp
14 end
14 end
15
15
16 create_table "custom_fields", :force => true do |t|
16 create_table "custom_fields", :force => true do |t|
17 t.column "name", :string, :limit => 30, :default => "", :null => false
17 t.column "name", :string, :limit => 30, :default => "", :null => false
18 t.column "typ", :integer, :limit => 6, :default => 0, :null => false
18 t.column "typ", :integer, :default => 0, :null => false
19 t.column "is_required", :boolean, :default => false, :null => false
19 t.column "is_required", :boolean, :default => false, :null => false
20 t.column "is_for_all", :boolean, :default => false, :null => false
20 t.column "is_for_all", :boolean, :default => false, :null => false
21 t.column "possible_values", :text, :default => "", :null => false
21 t.column "possible_values", :text, :default => "", :null => false
22 t.column "regexp", :string, :default => "", :null => false
22 t.column "regexp", :string, :default => "", :null => false
23 t.column "min_length", :integer, :limit => 4, :default => 0, :null => false
23 t.column "min_length", :integer, :default => 0, :null => false
24 t.column "max_length", :integer, :limit => 4, :default => 0, :null => false
24 t.column "max_length", :integer, :default => 0, :null => false
25 end
25 end
26
26
27 create_table "custom_fields_projects", :id => false, :force => true do |t|
27 create_table "custom_fields_projects", :id => false, :force => true do |t|
28 t.column "custom_field_id", :integer, :default => 0, :null => false
28 t.column "custom_field_id", :integer, :default => 0, :null => false
29 t.column "project_id", :integer, :default => 0, :null => false
29 t.column "project_id", :integer, :default => 0, :null => false
30 end
30 end
31
31
32 create_table "custom_values", :force => true do |t|
32 create_table "custom_values", :force => true do |t|
33 t.column "issue_id", :integer, :default => 0, :null => false
33 t.column "issue_id", :integer, :default => 0, :null => false
34 t.column "custom_field_id", :integer, :default => 0, :null => false
34 t.column "custom_field_id", :integer, :default => 0, :null => false
35 t.column "value", :text, :default => "", :null => false
35 t.column "value", :text, :default => "", :null => false
36 end
36 end
37
37
38 add_index "custom_values", ["issue_id"], :name => "custom_values_issue_id"
38 add_index "custom_values", ["issue_id"], :name => "custom_values_issue_id"
39
39
40 create_table "documents", :force => true do |t|
40 create_table "documents", :force => true do |t|
41 t.column "project_id", :integer, :default => 0, :null => false
41 t.column "project_id", :integer, :default => 0, :null => false
42 t.column "category_id", :integer, :default => 0, :null => false
42 t.column "category_id", :integer, :default => 0, :null => false
43 t.column "title", :string, :limit => 60, :default => "", :null => false
43 t.column "title", :string, :limit => 60, :default => "", :null => false
44 t.column "descr", :text, :default => "", :null => false
44 t.column "descr", :text, :default => "", :null => false
45 t.column "created_on", :timestamp
45 t.column "created_on", :timestamp
46 end
46 end
47
47
48 create_table "enumerations", :force => true do |t|
48 create_table "enumerations", :force => true do |t|
49 t.column "opt", :string, :limit => 4, :default => "", :null => false
49 t.column "opt", :string, :limit => 4, :default => "", :null => false
50 t.column "name", :string, :limit => 30, :default => "", :null => false
50 t.column "name", :string, :limit => 30, :default => "", :null => false
51 end
51 end
52
52
53 create_table "issue_categories", :force => true do |t|
53 create_table "issue_categories", :force => true do |t|
54 t.column "project_id", :integer, :default => 0, :null => false
54 t.column "project_id", :integer, :default => 0, :null => false
55 t.column "name", :string, :limit => 30, :default => "", :null => false
55 t.column "name", :string, :limit => 30, :default => "", :null => false
56 end
56 end
57
57
58 create_table "issue_histories", :force => true do |t|
58 create_table "issue_histories", :force => true do |t|
59 t.column "issue_id", :integer, :default => 0, :null => false
59 t.column "issue_id", :integer, :default => 0, :null => false
60 t.column "status_id", :integer, :default => 0, :null => false
60 t.column "status_id", :integer, :default => 0, :null => false
61 t.column "author_id", :integer, :default => 0, :null => false
61 t.column "author_id", :integer, :default => 0, :null => false
62 t.column "notes", :text, :default => "", :null => false
62 t.column "notes", :text, :default => "", :null => false
63 t.column "created_on", :timestamp
63 t.column "created_on", :timestamp
64 end
64 end
65
65
66 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
66 add_index "issue_histories", ["issue_id"], :name => "issue_histories_issue_id"
67
67
68 create_table "issue_statuses", :force => true do |t|
68 create_table "issue_statuses", :force => true do |t|
69 t.column "name", :string, :limit => 30, :default => "", :null => false
69 t.column "name", :string, :limit => 30, :default => "", :null => false
70 t.column "is_closed", :boolean, :default => false, :null => false
70 t.column "is_closed", :boolean, :default => false, :null => false
71 t.column "is_default", :boolean, :default => false, :null => false
71 t.column "is_default", :boolean, :default => false, :null => false
72 t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
72 t.column "html_color", :string, :limit => 6, :default => "FFFFFF", :null => false
73 end
73 end
74
74
75 create_table "issues", :force => true do |t|
75 create_table "issues", :force => true do |t|
76 t.column "tracker_id", :integer, :default => 0, :null => false
76 t.column "tracker_id", :integer, :default => 0, :null => false
77 t.column "project_id", :integer, :default => 0, :null => false
77 t.column "project_id", :integer, :default => 0, :null => false
78 t.column "subject", :string, :default => "", :null => false
78 t.column "subject", :string, :default => "", :null => false
79 t.column "descr", :text, :default => "", :null => false
79 t.column "descr", :text, :default => "", :null => false
80 t.column "category_id", :integer
80 t.column "category_id", :integer
81 t.column "status_id", :integer, :default => 0, :null => false
81 t.column "status_id", :integer, :default => 0, :null => false
82 t.column "assigned_to_id", :integer
82 t.column "assigned_to_id", :integer
83 t.column "priority_id", :integer, :default => 0, :null => false
83 t.column "priority_id", :integer, :default => 0, :null => false
84 t.column "fixed_version_id", :integer
84 t.column "fixed_version_id", :integer
85 t.column "author_id", :integer, :default => 0, :null => false
85 t.column "author_id", :integer, :default => 0, :null => false
86 t.column "created_on", :timestamp
86 t.column "created_on", :timestamp
87 t.column "updated_on", :timestamp
87 t.column "updated_on", :timestamp
88 end
88 end
89
89
90 add_index "issues", ["project_id"], :name => "issues_project_id"
90 add_index "issues", ["project_id"], :name => "issues_project_id"
91
91
92 create_table "members", :force => true do |t|
92 create_table "members", :force => true do |t|
93 t.column "user_id", :integer, :default => 0, :null => false
93 t.column "user_id", :integer, :default => 0, :null => false
94 t.column "project_id", :integer, :default => 0, :null => false
94 t.column "project_id", :integer, :default => 0, :null => false
95 t.column "role_id", :integer, :default => 0, :null => false
95 t.column "role_id", :integer, :default => 0, :null => false
96 t.column "created_on", :timestamp
96 t.column "created_on", :timestamp
97 end
97 end
98
98
99 create_table "news", :force => true do |t|
99 create_table "news", :force => true do |t|
100 t.column "project_id", :integer
100 t.column "project_id", :integer
101 t.column "title", :string, :limit => 60, :default => "", :null => false
101 t.column "title", :string, :limit => 60, :default => "", :null => false
102 t.column "shortdescr", :string, :default => "", :null => false
102 t.column "shortdescr", :string, :default => "", :null => false
103 t.column "descr", :text, :default => "", :null => false
103 t.column "descr", :text, :default => "", :null => false
104 t.column "author_id", :integer, :default => 0, :null => false
104 t.column "author_id", :integer, :default => 0, :null => false
105 t.column "created_on", :timestamp
105 t.column "created_on", :timestamp
106 end
106 end
107
107
108 create_table "permissions", :force => true do |t|
108 create_table "permissions", :force => true do |t|
109 t.column "controller", :string, :limit => 30, :default => "", :null => false
109 t.column "controller", :string, :limit => 30, :default => "", :null => false
110 t.column "action", :string, :limit => 30, :default => "", :null => false
110 t.column "action", :string, :limit => 30, :default => "", :null => false
111 t.column "descr", :string, :limit => 60, :default => "", :null => false
111 t.column "descr", :string, :limit => 60, :default => "", :null => false
112 t.column "public", :boolean, :default => false, :null => false
112 t.column "public", :boolean, :default => false, :null => false
113 t.column "sort", :integer, :default => 0, :null => false
113 t.column "sort", :integer, :default => 0, :null => false
114 t.column "mail_option", :boolean, :default => false, :null => false
114 t.column "mail_option", :boolean, :default => false, :null => false
115 t.column "mail_enabled", :boolean, :default => false, :null => false
115 t.column "mail_enabled", :boolean, :default => false, :null => false
116 end
116 end
117
117
118 create_table "permissions_roles", :id => false, :force => true do |t|
118 create_table "permissions_roles", :id => false, :force => true do |t|
119 t.column "permission_id", :integer, :default => 0, :null => false
119 t.column "permission_id", :integer, :default => 0, :null => false
120 t.column "role_id", :integer, :default => 0, :null => false
120 t.column "role_id", :integer, :default => 0, :null => false
121 end
121 end
122
122
123 add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
123 add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
124
124
125 create_table "projects", :force => true do |t|
125 create_table "projects", :force => true do |t|
126 t.column "name", :string, :limit => 30, :default => "", :null => false
126 t.column "name", :string, :limit => 30, :default => "", :null => false
127 t.column "descr", :string, :default => "", :null => false
127 t.column "descr", :string, :default => "", :null => false
128 t.column "homepage", :string, :limit => 60, :default => "", :null => false
128 t.column "homepage", :string, :limit => 60, :default => "", :null => false
129 t.column "public", :boolean, :default => true, :null => false
129 t.column "public", :boolean, :default => true, :null => false
130 t.column "created_on", :timestamp
130 t.column "created_on", :timestamp
131 t.column "updated_on", :timestamp
131 t.column "updated_on", :timestamp
132 end
132 end
133
133
134 create_table "roles", :force => true do |t|
134 create_table "roles", :force => true do |t|
135 t.column "name", :string, :limit => 30, :default => "", :null => false
135 t.column "name", :string, :limit => 30, :default => "", :null => false
136 end
136 end
137
137
138 create_table "trackers", :force => true do |t|
138 create_table "trackers", :force => true do |t|
139 t.column "name", :string, :limit => 30, :default => "", :null => false
139 t.column "name", :string, :limit => 30, :default => "", :null => false
140 t.column "is_in_chlog", :boolean, :default => false, :null => false
140 t.column "is_in_chlog", :boolean, :default => false, :null => false
141 end
141 end
142
142
143 create_table "users", :force => true do |t|
143 create_table "users", :force => true do |t|
144 t.column "login", :string, :limit => 30, :default => "", :null => false
144 t.column "login", :string, :limit => 30, :default => "", :null => false
145 t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
145 t.column "hashed_password", :string, :limit => 40, :default => "", :null => false
146 t.column "firstname", :string, :limit => 30, :default => "", :null => false
146 t.column "firstname", :string, :limit => 30, :default => "", :null => false
147 t.column "lastname", :string, :limit => 30, :default => "", :null => false
147 t.column "lastname", :string, :limit => 30, :default => "", :null => false
148 t.column "mail", :string, :limit => 60, :default => "", :null => false
148 t.column "mail", :string, :limit => 60, :default => "", :null => false
149 t.column "mail_notification", :boolean, :default => true, :null => false
149 t.column "mail_notification", :boolean, :default => true, :null => false
150 t.column "admin", :boolean, :default => false, :null => false
150 t.column "admin", :boolean, :default => false, :null => false
151 t.column "locked", :boolean, :default => false, :null => false
151 t.column "locked", :boolean, :default => false, :null => false
152 t.column "last_login_on", :datetime
152 t.column "last_login_on", :datetime
153 t.column "language", :string, :limit => 2, :default => "", :null => false
153 t.column "language", :string, :limit => 2, :default => "", :null => false
154 t.column "created_on", :timestamp
154 t.column "created_on", :timestamp
155 t.column "updated_on", :timestamp
155 t.column "updated_on", :timestamp
156 end
156 end
157
157
158 create_table "versions", :force => true do |t|
158 create_table "versions", :force => true do |t|
159 t.column "project_id", :integer, :default => 0, :null => false
159 t.column "project_id", :integer, :default => 0, :null => false
160 t.column "name", :string, :limit => 30, :default => "", :null => false
160 t.column "name", :string, :limit => 30, :default => "", :null => false
161 t.column "descr", :string, :default => "", :null => false
161 t.column "descr", :string, :default => "", :null => false
162 t.column "date", :date, :null => false
162 t.column "date", :date, :null => false
163 t.column "created_on", :timestamp
163 t.column "created_on", :timestamp
164 t.column "updated_on", :timestamp
164 t.column "updated_on", :timestamp
165 end
165 end
166
166
167 create_table "workflows", :force => true do |t|
167 create_table "workflows", :force => true do |t|
168 t.column "tracker_id", :integer, :default => 0, :null => false
168 t.column "tracker_id", :integer, :default => 0, :null => false
169 t.column "old_status_id", :integer, :default => 0, :null => false
169 t.column "old_status_id", :integer, :default => 0, :null => false
170 t.column "new_status_id", :integer, :default => 0, :null => false
170 t.column "new_status_id", :integer, :default => 0, :null => false
171 t.column "role_id", :integer, :default => 0, :null => false
171 t.column "role_id", :integer, :default => 0, :null => false
172 end
172 end
173
173
174 # project
174 # project
175 Permission.create :controller => "projects", :action => "show", :descr => "Overview", :sort => 100, :public => true
175 Permission.create :controller => "projects", :action => "show", :descr => "Overview", :sort => 100, :public => true
176 Permission.create :controller => "projects", :action => "changelog", :descr => "View change log", :sort => 105, :public => true
176 Permission.create :controller => "projects", :action => "changelog", :descr => "View change log", :sort => 105, :public => true
177 Permission.create :controller => "reports", :action => "issue_report", :descr => "View reports", :sort => 110, :public => true
177 Permission.create :controller => "reports", :action => "issue_report", :descr => "View reports", :sort => 110, :public => true
178 Permission.create :controller => "projects", :action => "settings", :descr => "Settings", :sort => 150
178 Permission.create :controller => "projects", :action => "settings", :descr => "Settings", :sort => 150
179 Permission.create :controller => "projects", :action => "edit", :descr => "Edit", :sort => 151
179 Permission.create :controller => "projects", :action => "edit", :descr => "Edit", :sort => 151
180 # members
180 # members
181 Permission.create :controller => "projects", :action => "list_members", :descr => "View list", :sort => 200, :public => true
181 Permission.create :controller => "projects", :action => "list_members", :descr => "View list", :sort => 200, :public => true
182 Permission.create :controller => "projects", :action => "add_member", :descr => "New member", :sort => 220
182 Permission.create :controller => "projects", :action => "add_member", :descr => "New member", :sort => 220
183 Permission.create :controller => "members", :action => "edit", :descr => "Edit", :sort => 221
183 Permission.create :controller => "members", :action => "edit", :descr => "Edit", :sort => 221
184 Permission.create :controller => "members", :action => "destroy", :descr => "Delete", :sort => 222
184 Permission.create :controller => "members", :action => "destroy", :descr => "Delete", :sort => 222
185 # versions
185 # versions
186 Permission.create :controller => "projects", :action => "add_version", :descr => "New version", :sort => 320
186 Permission.create :controller => "projects", :action => "add_version", :descr => "New version", :sort => 320
187 Permission.create :controller => "versions", :action => "edit", :descr => "Edit", :sort => 321
187 Permission.create :controller => "versions", :action => "edit", :descr => "Edit", :sort => 321
188 Permission.create :controller => "versions", :action => "destroy", :descr => "Delete", :sort => 322
188 Permission.create :controller => "versions", :action => "destroy", :descr => "Delete", :sort => 322
189 # issue categories
189 # issue categories
190 Permission.create :controller => "projects", :action => "add_issue_category", :descr => "New issue category", :sort => 420
190 Permission.create :controller => "projects", :action => "add_issue_category", :descr => "New issue category", :sort => 420
191 Permission.create :controller => "issue_categories", :action => "edit", :descr => "Edit", :sort => 421
191 Permission.create :controller => "issue_categories", :action => "edit", :descr => "Edit", :sort => 421
192 Permission.create :controller => "issue_categories", :action => "destroy", :descr => "Delete", :sort => 422
192 Permission.create :controller => "issue_categories", :action => "destroy", :descr => "Delete", :sort => 422
193 # issues
193 # issues
194 Permission.create :controller => "projects", :action => "list_issues", :descr => "View list", :sort => 1000, :public => true
194 Permission.create :controller => "projects", :action => "list_issues", :descr => "View list", :sort => 1000, :public => true
195 Permission.create :controller => "issues", :action => "show", :descr => "View", :sort => 1005, :public => true
195 Permission.create :controller => "issues", :action => "show", :descr => "View", :sort => 1005, :public => true
196 Permission.create :controller => "issues", :action => "download", :descr => "Download file", :sort => 1010, :public => true
196 Permission.create :controller => "issues", :action => "download", :descr => "Download file", :sort => 1010, :public => true
197 Permission.create :controller => "projects", :action => "add_issue", :descr => "Report an issue", :sort => 1050, :mail_option => 1, :mail_enabled => 1
197 Permission.create :controller => "projects", :action => "add_issue", :descr => "Report an issue", :sort => 1050, :mail_option => 1, :mail_enabled => 1
198 Permission.create :controller => "issues", :action => "edit", :descr => "Edit", :sort => 1055
198 Permission.create :controller => "issues", :action => "edit", :descr => "Edit", :sort => 1055
199 Permission.create :controller => "issues", :action => "change_status", :descr => "Change status", :sort => 1060, :mail_option => 1, :mail_enabled => 1
199 Permission.create :controller => "issues", :action => "change_status", :descr => "Change status", :sort => 1060, :mail_option => 1, :mail_enabled => 1
200 Permission.create :controller => "issues", :action => "destroy", :descr => "Delete", :sort => 1065
200 Permission.create :controller => "issues", :action => "destroy", :descr => "Delete", :sort => 1065
201 Permission.create :controller => "issues", :action => "add_attachment", :descr => "Add file", :sort => 1070
201 Permission.create :controller => "issues", :action => "add_attachment", :descr => "Add file", :sort => 1070
202 Permission.create :controller => "issues", :action => "destroy_attachment", :descr => "Delete file", :sort => 1075
202 Permission.create :controller => "issues", :action => "destroy_attachment", :descr => "Delete file", :sort => 1075
203 # news
203 # news
204 Permission.create :controller => "projects", :action => "list_news", :descr => "View list", :sort => 1100, :public => true
204 Permission.create :controller => "projects", :action => "list_news", :descr => "View list", :sort => 1100, :public => true
205 Permission.create :controller => "news", :action => "show", :descr => "View", :sort => 1101, :public => true
205 Permission.create :controller => "news", :action => "show", :descr => "View", :sort => 1101, :public => true
206 Permission.create :controller => "projects", :action => "add_news", :descr => "Add", :sort => 1120
206 Permission.create :controller => "projects", :action => "add_news", :descr => "Add", :sort => 1120
207 Permission.create :controller => "news", :action => "edit", :descr => "Edit", :sort => 1121
207 Permission.create :controller => "news", :action => "edit", :descr => "Edit", :sort => 1121
208 Permission.create :controller => "news", :action => "destroy", :descr => "Delete", :sort => 1122
208 Permission.create :controller => "news", :action => "destroy", :descr => "Delete", :sort => 1122
209 # documents
209 # documents
210 Permission.create :controller => "projects", :action => "list_documents", :descr => "View list", :sort => 1200, :public => true
210 Permission.create :controller => "projects", :action => "list_documents", :descr => "View list", :sort => 1200, :public => true
211 Permission.create :controller => "documents", :action => "show", :descr => "View", :sort => 1201, :public => true
211 Permission.create :controller => "documents", :action => "show", :descr => "View", :sort => 1201, :public => true
212 Permission.create :controller => "documents", :action => "download", :descr => "Download", :sort => 1202, :public => true
212 Permission.create :controller => "documents", :action => "download", :descr => "Download", :sort => 1202, :public => true
213 Permission.create :controller => "projects", :action => "add_document", :descr => "Add", :sort => 1220
213 Permission.create :controller => "projects", :action => "add_document", :descr => "Add", :sort => 1220
214 Permission.create :controller => "documents", :action => "edit", :descr => "Edit", :sort => 1221
214 Permission.create :controller => "documents", :action => "edit", :descr => "Edit", :sort => 1221
215 Permission.create :controller => "documents", :action => "destroy", :descr => "Delete", :sort => 1222
215 Permission.create :controller => "documents", :action => "destroy", :descr => "Delete", :sort => 1222
216 Permission.create :controller => "documents", :action => "add_attachment", :descr => "Add file", :sort => 1223
216 Permission.create :controller => "documents", :action => "add_attachment", :descr => "Add file", :sort => 1223
217 Permission.create :controller => "documents", :action => "destroy_attachment", :descr => "Delete file", :sort => 1224
217 Permission.create :controller => "documents", :action => "destroy_attachment", :descr => "Delete file", :sort => 1224
218 # files
218 # files
219 Permission.create :controller => "projects", :action => "list_files", :descr => "View list", :sort => 1300, :public => true
219 Permission.create :controller => "projects", :action => "list_files", :descr => "View list", :sort => 1300, :public => true
220 Permission.create :controller => "versions", :action => "download", :descr => "Download", :sort => 1301, :public => true
220 Permission.create :controller => "versions", :action => "download", :descr => "Download", :sort => 1301, :public => true
221 Permission.create :controller => "projects", :action => "add_file", :descr => "Add", :sort => 1320
221 Permission.create :controller => "projects", :action => "add_file", :descr => "Add", :sort => 1320
222 Permission.create :controller => "versions", :action => "destroy_file", :descr => "Delete", :sort => 1322
222 Permission.create :controller => "versions", :action => "destroy_file", :descr => "Delete", :sort => 1322
223
223
224 # create default administrator account
224 # create default administrator account
225 user = User.create :login => "admin", :password => "admin", :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
225 user = User.create :login => "admin", :password => "admin", :firstname => "redMine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
226 user.admin = true
226 user.admin = true
227 user.save
227 user.save
228
228
229
229
230 end
230 end
231
231
232 def self.down
232 def self.down
233 drop_table :attachments
233 drop_table :attachments
234 drop_table :custom_fields
234 drop_table :custom_fields
235 drop_table :custom_fields_projects
235 drop_table :custom_fields_projects
236 drop_table :custom_values
236 drop_table :custom_values
237 drop_table :documents
237 drop_table :documents
238 drop_table :enumerations
238 drop_table :enumerations
239 drop_table :issue_categories
239 drop_table :issue_categories
240 drop_table :issue_histories
240 drop_table :issue_histories
241 drop_table :issue_statuses
241 drop_table :issue_statuses
242 drop_table :issues
242 drop_table :issues
243 drop_table :members
243 drop_table :members
244 drop_table :news
244 drop_table :news
245 drop_table :permissions
245 drop_table :permissions
246 drop_table :permissions_roles
246 drop_table :permissions_roles
247 drop_table :projects
247 drop_table :projects
248 drop_table :roles
248 drop_table :roles
249 drop_table :trackers
249 drop_table :trackers
250 drop_table :users
250 drop_table :users
251 drop_table :versions
251 drop_table :versions
252 drop_table :workflows
252 drop_table :workflows
253 end
253 end
254 end
254 end
General Comments 0
You need to be logged in to leave comments. Login now