Commits

Anonymous committed 36ad5cf

SQL error using PostgreSQL

Comments (0)

Files changed (5)

+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>redmine</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.rubypeople.rdt.core.rubybuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.radrails.rails.ui.railsnature</nature>
+		<nature>org.rubypeople.rdt.core.rubynature</nature>
+	</natures>
+</projectDescription>

redmine/app/controllers/reports_controller.rb

                                                   i.status_id=s.id 
                                                   and i.tracker_id=t.id
                                                   and i.project_id=#{@project.id}
-                                                group by s.id, t.id")
+                                                group by s.id, s.is_closed, t.id")
     @priorities = Enumeration::get_values('IPRI')
     @issues_by_priority = 
       ActiveRecord::Base.connection.select_all("select    s.id as status_id, 
                                                   i.status_id=s.id 
                                                   and i.priority_id=p.id
                                                   and i.project_id=#{@project.id}
-                                                group by s.id, p.id")
+                                                group by s.id, s.is_closed, p.id")
     @categories = @project.issue_categories
     @issues_by_category = 
       ActiveRecord::Base.connection.select_all("select    s.id as status_id, 
                                                   i.status_id=s.id 
                                                   and i.category_id=c.id
                                                   and i.project_id=#{@project.id}
-                                                group by s.id, c.id")
+                                                group by s.id, s.is_closed, c.id")
   end
   
   

redmine/config/database.yml

   host: localhost
   username: root
   password:
+  
+development_pgsql:
+  adapter: postgresql
+  database: redmine
+  host: localhost
+  username: postgres
+  password: "postgres"
 
 test:
   adapter: mysql

redmine/config/environments/development_pgsql.rb

+# Settings specified here will take precedence over those in config/environment.rb
+
+# In the development environment your application's code is reloaded on
+# every request.  This slows down response time but is perfect for development
+# since you don't have to restart the webserver when you make code changes.
+config.cache_classes     = false
+
+# Log error messages when you accidentally call methods on nil.
+config.whiny_nils        = true
+
+# Enable the breakpoint server that script/breakpointer connects to
+config.breakpoint_server = true
+
+# Show full error reports and disable caching
+config.action_controller.consider_all_requests_local = true
+config.action_controller.perform_caching             = false
+
+# Don't care if the mailer can't send
+config.action_mailer.raise_delivery_errors = false

redmine/db/migrate/001_setup.rb

   
     create_table "custom_fields", :force => true do |t|
       t.column "name", :string, :limit => 30, :default => "", :null => false
-      t.column "typ", :integer, :limit => 6, :default => 0, :null => false
+      t.column "typ", :integer, :default => 0, :null => false
       t.column "is_required", :boolean, :default => false, :null => false
       t.column "is_for_all", :boolean, :default => false, :null => false
       t.column "possible_values", :text, :default => "", :null => false
       t.column "regexp", :string, :default => "", :null => false
-      t.column "min_length", :integer, :limit => 4, :default => 0, :null => false
-      t.column "max_length", :integer, :limit => 4, :default => 0, :null => false
+      t.column "min_length", :integer, :default => 0, :null => false
+      t.column "max_length", :integer, :default => 0, :null => false
     end
   
     create_table "custom_fields_projects", :id => false, :force => true do |t|