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