Project

General

Profile

Actions

Defect #12341

closed

MySQL Error after upgrading to 2.1.2

Added by Mark P over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

This is also listed in the forums here:
http://www.redmine.org/boards/2/topics/34275

I've got a dev server we've been trying out 2.x with. We take our current 1.0.1 database, run db:migrate on it and with 2.0 it's always gone fine. Now that we went from 2.0.4 to 2.1.2 there's a problem.

When I try to create a new issue, I get a 500 error. Looking at the dev log I see this:

Mysql2::Error: Column 'position' cannot be null:
INSERT INTO `issues` (`assigned_to_id`, `author_id`, `category_id`, `created_on`, `description`, `done_ratio`, `due_date`, `estimated_hours`, `fixed_version_id`, `is_private`, `lft`, `lock_version`, `parent_id`, `position`, `priority_id`, `project_id`, `remaining_hours`, `rgt`, `root_id`, `start_date`, `status_id`, `story_points`, `subject`, `tracker_id`, `updated_on`)
VALUES (NULL, 36, NULL, '2012-11-09 14:46:59', 'asfasfasfsadf', 0, NULL, NULL, NULL, 0, 1, 0, NULL, NULL, 4, 1, NULL, 2, NULL, '2012-11-09', 1, NULL, 'test', 1, '2012-11-09 14:46:59')

I see in the database.rb that in the issues table there is a not nullable field called position. That wasn't in the 1.x database we have and there are no plugins installed so I'm pretty sure this is a stock field.

Current about:
Environment:
Redmine version 2.1.2.stable
Ruby version 1.9.3 (x86_64-linux)
Rails version 3.2.8
Environment development
Database adapter Mysql2
Redmine plugins:
no plugin installed

What are we missing that position ends up being null on the INSERT?

[root@redmine]# RAILS_ENV=development rake about
About your application's environment
Ruby version 1.9.3 (x86_64-linux)
RubyGems version 1.8.24
Rack version 1.4
Rails version 3.2.8
Active Record version 3.2.8
Action Pack version 3.2.8
Active Resource version 3.2.8
Action Mailer version 3.2.8
Active Support version 3.2.8
Middleware ActionDispatch::Static, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x00000000cfb2a0>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport, OpenIdAuthentication
Application root /var/www/redmine/redmine-2.1.2
Environment development
Database adapter mysql2
Database schema version 20120731164049

Actions #1

Updated by Jean-Philippe Lang over 11 years ago

  • Status changed from New to Closed
  • Resolution set to Invalid

There's no position column in the issues table in Redmine core. This column must have been created by a plugin that you previously installed.

Actions

Also available in: Atom PDF