Migrated from 1.2 -> v2.3.3 stable - queries table lacks 'is_public' column
Added by Colin Sheaff about 11 years ago
I didn't see any issues during migration. Can I just add this column manually or should I re-run migration, if so how? I've run `rake db:migrate RAILS_ENV=production` and `rake redmine:plugins:migrate RAILS_ENV=production` several times recently without error, so how can I ask rake to try and re-run migration from 1.2 again assuming that's advisable in the first place?
mysql> show columns from queries; +---------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | project_id | int(11) | YES | MUL | NULL | | | name | varchar(255) | NO | | | | | filters | text | YES | | NULL | | | user_id | int(11) | NO | MUL | 0 | | | column_names | text | YES | | NULL | | | sort_criteria | text | YES | | NULL | | | group_by | varchar(255) | YES | | NULL | | | type | varchar(255) | YES | | NULL | | | visibility | int(11) | YES | | 0 | | | options | text | YES | | NULL | | +---------------+--------------+------+-----+---------+----------------+ 11 rows in set (0.00 sec)
I'm currently getting 500 server errors on many pages including /projects/example/issues & /projects/example/issues/gantt.
Production.log shows:
Started GET "/projects/example/issues/gantt" for 129.105.107.143 at 2013-09-23 15:36:15 -0500
Processing by GanttsController#show as HTML
Parameters: {"project_id"=>"example"}
Current user: user (id=15)
Rendered queries/_filters.html.erb (13.3ms)
DEPRECATION WARNING: Version#completed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #completed_percent instead. (called from completed_pourcent at /var/www/html/redmine-2.3/app/models/version.rb:124)
DEPRECATION WARNING: Version#completed_pourcent is deprecated and will be removed in Redmine 3.0. Please use #completed_percent instead. (called from completed_pourcent at /var/www/html/redmine-2.3/app/models/version.rb:124)
Rendered issues/_sidebar.html.erb (5.1ms)
Rendered plugins/redmine_gantt_with_date/app/views/gantts/show.html.erb within layouts/base (289.0ms)
Completed 500 Internal Server Error in 331ms
ActionView::Template::Error (Mysql2::Error: Unknown column 'queries.is_public' in 'where clause': SELECT `queries`.`id` AS t0_r0, `queries`.`project_id` AS t0_r1, `queries`.`name` AS t0_r2, `queries`.`filters` AS t0_r3, `queries`.`user_id` AS t0_r4, `queries`.`column_names` AS t0_r5, `queries`.`sort_criteria` AS t0_r6, `queries`.`group_by` AS t0_r7, `queries`.`type` AS t0_r8, `queries`.`visibility` AS t0_r9, `queries`.`options` AS t0_r10, `projects`.`id` AS t1_r0, `projects`.`name` AS t1_r1, `projects`.`description` AS t1_r2, `projects`.`homepage` AS t1_r3, `projects`.`is_public` AS t1_r4, `projects`.`parent_id` AS t1_r5, `projects`.`created_on` AS t1_r6, `projects`.`updated_on` AS t1_r7, `projects`.`identifier` AS t1_r8, `projects`.`status` AS t1_r9, `projects`.`lft` AS t1_r10, `projects`.`rgt` AS t1_r11, `projects`.`inherit_members` AS t1_r12 FROM `queries` LEFT OUTER JOIN `projects` ON `projects`.`id` = `queries`.`project_id` WHERE `queries`.`type` IN ('IssueQuery') AND ((queries.project_id IS NULL OR (projects.status <> 9 AND projects.id IN (SELECT em.project_id FROM enabled_modules em WHERE em.name='issue_tracking'))) AND (queries.is_public = 1 OR queries.user_id = 15)) AND (project_id IS NULL OR project_id = 17) ORDER BY queries.name ASC):
13: <% end >
14: <= call_hook(:view_issues_sidebar_planning_bottom) >
15:
16: <= render_sidebar_queries >
17: <= call_hook(:view_issues_sidebar_queries_bottom) %>
app/helpers/issues_helper.rb:187:in `sidebar_queries'
app/helpers/issues_helper.rb:210:in `render_sidebar_queries'
app/views/issues/_sidebar.html.erb:16:in `_app_views_issues__sidebar_html_erb___1789325176475162516_173892380'
app/helpers/application_helper.rb:1149:in `content_for'
app/controllers/gantts_controller.rb:43:in `block (2 levels) in show'
app/controllers/gantts_controller.rb:42:in `show'
Replies (2)
RE: Migrated from 1.2 -> v2.3.3 stable - queries table lacks 'is_public' column - Added by Ivan Cenov about 11 years ago
See this thread, you may find some hints there.
http://www.redmine.org/boards/2/topics/39614
RE: Migrated from 1.2 -> v2.3.3 stable - queries table lacks 'is_public' column - Added by Colin Sheaff about 11 years ago
Thanks,
I went ahead and just manually updated the `queries` table and that seems to work so far. I logged into mysql as 'root' and then ran:
mysql> use redmine;
mysql> ALTER TABLE queries ADD is_public TINYINT NOT NULL DEFAULT 0;