ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default'
Added by Lawrence Krubner over 11 years ago
Last Wednesday I was given a task to upgrade our Redmine installation, from 1.2 to 2.2. This has been a struggle. I now have it almost working using Phusion Passenger Standalone, Centos 6.3, Ruby 1.9.3.
I can now go here and see Redmine:
/
but if I go here:
/projects/systems
(We have a project called "systems") then I get the following error. Any thoughts about what causes this?
Rendered projects/_members_box.html.erb (51.2ms)
Rendered projects/show.html.erb within layouts/base (95.3ms)
[[1m[[35mUserPreference Load (0.4ms)^[[0m SELECT `user_preferences`.* FROM `user_preferences` WHERE `user_preferences`.`user_id` = 176 LIMIT 1
[[1m[[36mSQL (2.4ms)^[[0m ^[[1mSELECT `members`.`id` AS t0_r0, `members`.`user_id` AS t0_r1, `members`.`project_id` AS t0_r2, `members`.`created_on` AS t0_r3, `members`.`mai\
l_notification` AS t0_r4, `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, `roles`.`id` AS t2_r0, `roles`.`name` AS t2_r1, `roles`.`position` AS t2_r2, `roles`.`assignable` AS t2_r3, `roles`.`builtin` AS t2_r\
4, `roles`.`permissions` AS t2_r5, `roles`.`issues_visibility` AS t2_r6 FROM `members` LEFT OUTER JOIN `projects` ON `projects`.`id` = `members`.`project_id` LEFT OUTER JOIN `mem\
ber_roles` ON `member_roles`.`member_id` = `members`.`id` LEFT OUTER JOIN `roles` ON `roles`.`id` = `member_roles`.`role_id` WHERE `members`.`user_id` = 176 AND (projects.status<\
[[1m[[35m (1.6ms)^[[0m SELECT COUNT FROM `versions` LEFT OUTER JOIN `projects` ON `projects`.`id` = `versions`.`project_id` WHERE (projects.id = 19\9) ORDER BY projects.name^[[0m
OR (projects.status <> 9 AND ( versions.sharing = 'system' OR (projects.lft >= 97 AND projects.rgt <= 98 AND versions.sharing = 'tree') OR (projects.lft < 97 AND projects.rgt > \
98 AND versions.sharing IN ('hierarchy', 'descendants')) OR (projects.lft > 97 AND projects.rgt < 98 AND versions.sharing = 'hierarchy'))))
[[1m[[36mTracker Load (0.2ms)^[[0m [[1mSELECT `trackers`.* FROM `trackers` WHERE `trackers`.`id` IN (2)[[0m
[[1m[[35mIssuePriority Load (0.3ms)^[[0m SELECT `enumerations`.* FROM `enumerations` WHERE `enumerations`.`type` IN ('IssuePriority') AND `enumerations`.`is_default` = 1 ORD\
ER BY enumerations.position ASC LIMIT 1
[[1m[[36m (3.2ms)^[[0m [[1mselect version from schema_migrations where version like '%-redmine_backlogs'[[0m
[[1m[[35mCACHE (0.0ms)^[[0m SELECT `trackers`.* FROM `trackers` WHERE `trackers`.`id` IN (2)
[[1m[[36mCACHE (0.0ms)^[[0m [[1mSELECT `enumerations`.* FROM `enumerations` WHERE `enumerations`.`type` IN ('IssuePriority') AND `enumerations`.`is_default` = 1 ORDER BY en\
umerations.position ASC LIMIT 1[[0m
[[1m[[35m (0.3ms)^[[0m select version from schema_migrations where version like '%-redmine_backlogs'
[[1m[[36mWiki Load (0.3ms)^[[0m [[1mSELECT `wikis`.* FROM `wikis` WHERE `wikis`.`project_id` = 19 LIMIT 1[[0m
[[1m[[35m (0.4ms)^[[0m SELECT COUNT() FROM `boards` WHERE `boards`.`project_id` = 19
[[1m[[36mRepository Load (0.6ms)^[[0m [[1mSELECT `repositories`. FROM `repositories` WHERE `repositories`.`project_id` = 19 AND (is_default = 1) LIMIT 1[[0m
Mysql2::Error: Unknown column 'is_default' in 'where clause': SELECT `repositories`.* FROM `repositories` WHERE `repositories`.`project_id` = 19 AND (is_default = 1) LIMIT 1
Completed 500 Internal Server Error in 657ms
ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' in 'where clause': SELECT `repositories`.* FROM `repositories` WHERE `repositories`.`project_id` = 19 AN\
D (is_default = 1) LIMIT 1):
42: <% end >
43:
44:
<= page_header_title %>
45:
46: <% if display_main_menu?(@project) >
47: <div id="main-menu">
48: <= render_main_menu(@project) %>
lib/redmine.rb:213:in `block (2 levels) in <top (required)>'
lib/redmine/menu_manager.rb:196:in `call'
lib/redmine/menu_manager.rb:196:in `allowed_node?'
lib/redmine/menu_manager.rb:166:in `block in menu_items_for'
lib/redmine/menu_manager.rb:165:in `each'
lib/redmine/menu_manager.rb:165:in `menu_items_for'
lib/redmine/menu_manager.rb:90:in `render_menu'
lib/redmine/menu_manager.rb:80:in `render_main_menu'
app/views/layouts/base.html.erb:45:in `_app_views_layouts_base_html_erb___753726846178084690_33262140'
app/controllers/projects_controller.rb:165:in `show'
Replies (7)
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
I just noticed that when I try to run the plugins migration, I get this error:
undefined method `private_notes?' for #<Journal:0x00000006e97ab8>
When I run this:
rake redmine:plugins:migrate RAILS_ENV=production
I get the following error. Can anyone suggest where the method "private_notes?" is called, and how I can stop the error?
rake redmine:plugins:migrate RAILS_ENV=production
Migrating redmine_backlogs (Redmine Backlogs)...
NullTaskPosition: migrating =============================================
-- execute("update issues set position = null where tracker_id = 5")
> 0.0986s create_table(:backlogs_tmp_set_task_tracker)
-
> 0.0617s execute("insert into backlogs_tmp_set_task_tracker (story_root_id, story_lft, story_rgt)\n select root_id, lft, rgt from issues where tracker_id in (2)")
-
> 0.0230s execute("update issues set tracker_id = 5\n where exists (select 1 from backlogs_tmp_set_task_tracker where root_id = story_root_id and lft > story_lft and rgt < story_rgt)")
-
> 6.2409s drop_table(:backlogs_tmp_set_task_tracker)
-
-> 0.0044s
NullTaskPosition: migrated (6.5343s) ====================================
ReinstateRemaining: migrated (0.0018s) ================================== FractionalPoints: migrating =============================================
-- add_column(:issues, :fractional_story_points, :float)
-
-
-
-
-
-> 0.7040s
FractionalPoints: migrated (3.2496s) ==================================== AddStoryPositions: migrating ============================================
-- execute("select max(position) from issues")
-
-> 0.0619s
AddStoryPositions: migrated (0.2291s) =================================== AddIndexOnIssuesPosition: migrating =====================================
-- add_index(:issues, :position)
-> 0.9063s
AddIndexOnIssuesPosition: migrated (0.9064s) ============================ SumRemainingHours: migrating ============================================
-- create_table(:backlogs_tmp_story_remaining_hours)
-
-
-
-
-> 0.0045s
SumRemainingHours: migrated (0.7655s) =================================== ExpandedJournal: migrating ==============================================
-- create_table(:rb_journals)
-> 0.0049s
ExpandedJournal: migrated (0.0050s) ===================================== RebuildJournal: migrating ===============================================
-- add_index(:rb_journals, :issue_id)
-
-
-
-
-> 0.0062s
RebuildJournal: migrated (0.0317s) ====================================== UniquePositions: migrating ==============================================
-- change_column(:issues, :position, :integer, {:null=>false})
-
-
-> 0.6825s
UniquePositions: migrated (4.7578s) ===================================== CleanJournal: migrating =================================================
-- execute("drop table if exists _backlogs_tmp_journal")
-
-
-
-
-> 0.0002s
CleanJournal: migrated (0.0091s) ======================================== FixMissingJournal: migrating ============================================
rake aborted!
An error has occurred, all later migrations canceled:
undefined method `private_notes?' for #<Journal:0x00000006e97ab8>
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activemodel-3.2.11/lib/active_model/attribute_methods.rb:407:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/attribute_methods.rb:149:in `method_missing'
/home/lawrence/redmine-2.2/app/models/journal.rb:114:in `split_private_notes'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:407:in `_run__3776721542564599916__create__1065582607548075391__callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/callbacks.rb:268:in `create'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/persistence.rb:348:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:447:in `_run__3776721542564599916__save__1065582607548075391__callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/callbacks.rb:264:in `create_or_update'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/persistence.rb:104:in `save!'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/validations.rb:56:in `save!'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/transactions.rb:264:in `block in save!'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/transactions.rb:264:in `save!'
/home/lawrence/redmine-2.2/plugins/redmine_backlogs/db/migrate/035_fix_missing_journal.rb:23:in `block in up'
/home/lawrence/redmine-2.2/plugins/redmine_backlogs/db/migrate/035_fix_missing_journal.rb:6:in `each'
/home/lawrence/redmine-2.2/plugins/redmine_backlogs/db/migrate/035_fix_missing_journal.rb:6:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:370:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:410:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:389:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:528:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:777:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:777:in `ddl_transaction'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:719:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:570:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:551:in `migrate'
/home/lawrence/redmine-2.2/lib/redmine/plugin.rb:449:in `migrate_plugin'
/home/lawrence/redmine-2.2/lib/redmine/plugin.rb:421:in `migrate'
/home/lawrence/redmine-2.2/lib/redmine/plugin.rb:435:in `block in migrate'
/home/lawrence/redmine-2.2/lib/redmine/plugin.rb:434:in `each'
/home/lawrence/redmine-2.2/lib/redmine/plugin.rb:434:in `migrate'
/home/lawrence/redmine-2.2/lib/tasks/redmine.rake:69:in `block (3 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => redmine:plugins:migrate
(See full trace by running task with --trace)
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
If I do this:
grep -iR "private_notes" * | grep -v svn
Then it appears that "private_notes?" is everywhere. See the output below. But is this a Redmine error, or a Rails error, or an error that traces back to one of the plugins I've installed into Redmine? Can anyone offer me any guidance?
This is the full output:
grep -iR "private_notes" * | grep -v svn
app/controllers/issues_controller.rb: @journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
app/controllers/issues_controller.rb: @conflict_journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
app/models/mail_handler.rb: if from_journal && from_journal.private_notes?
app/models/mail_handler.rb: issue.private_notes = true
app/models/issue.rb: ["(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(User.current, :view_private_notes)}))", false]
app/models/issue.rb: delegate :notes, :notes=, :private_notes, :private_notes=, :to => :current_journal, :allow_nil => true
app/models/issue.rb: safe_attributes 'private_notes',
app/models/journal.rb: before_create :split_private_notes
app/models/journal.rb: where("(#{Journal.table_name}.private_notes = ? OR (#{Project.allowed_to_condition(user, :view_private_notes, *args)}))", false)
app/models/journal.rb: s << ' private-notes' if private_notes?
app/models/journal.rb: if private_notes?
app/models/journal.rb: notified = notified.select {|user| user.allowed_to?(:view_private_notes, journalized.project)}
app/models/journal.rb: if private_notes?
app/models/journal.rb: notified = notified.select {|user| user.allowed_to?(:view_private_notes, journalized.project)}
app/models/journal.rb: def split_private_notes
app/models/journal.rb: if private_notes?
app/models/journal.rb: journal = Journal.new(:journalized => journalized, :user => user, :notes => nil, :private_notes => false)
app/models/journal.rb: self.private_notes = false
app/views/issues/_edit.html.erb: <% if @issue.safe_attribute? 'private_notes' >
app/views/issues/_edit.html.erb: <label for="issue_private_notes"><= f.check_box :private_notes, :no_label => true > <= l(:field_private_notes) ></label>
app/views/journals/new.js.erb: if @journal &x%x @journal.private_notes?
app/views/journals/new.js.erb:$('#issue_private_notes').attr('checked', true);
config/locales/lv.yml: field_private_notes: Private notes
config/locales/lv.yml: permission_view_private_notes: View private notes
config/locales/pt-BR.yml: field_private_notes: Private notes
config/locales/pt-BR.yml: permission_view_private_notes: View private notes
config/locales/mk.yml: field_private_notes: Private notes
config/locales/mk.yml: permission_view_private_notes: View private notes
config/locales/cs.yml: field_private_notes: Private notes
config/locales/cs.yml: permission_view_private_notes: View private notes
config/locales/mn.yml: field_private_notes: Private notes
config/locales/mn.yml: permission_view_private_notes: View private notes
config/locales/gl.yml: field_private_notes: Private notes
config/locales/gl.yml: permission_view_private_notes: View private notes
config/locales/lt.yml: field_private_notes: Privačios žinutės
config/locales/lt.yml: permission_view_private_notes: Matyti privačias žinutes
config/locales/bs.yml: field_private_notes: Private notes
config/locales/bs.yml: permission_view_private_notes: View private notes
config/locales/zh-TW.yml: field_private_notes: 私人筆記
config/locales/zh-TW.yml: permission_view_private_notes: 檢視私人筆記
config/locales/ko.yml: field_private_notes: 비공개 덧글
config/locales/ko.yml: permission_view_private_notes: 비공개 덧글 보기
config/locales/fa.yml: field_private_notes: Private notes
config/locales/fa.yml: permission_view_private_notes: View private notes
config/locales/th.yml: field_private_notes: Private notes
config/locales/th.yml: permission_view_private_notes: View private notes
config/locales/pl.yml: field_private_notes: Private notes
config/locales/pl.yml: permission_view_private_notes: View private notes
config/locales/en-GB.yml: field_private_notes: Private notes
config/locales/en-GB.yml: permission_view_private_notes: View private notes
config/locales/sk.yml: field_private_notes: Private notes
config/locales/sk.yml: permission_view_private_notes: View private notes
config/locales/pt.yml: field_private_notes: Private notes
config/locales/pt.yml: permission_view_private_notes: View private notes
config/locales/it.yml: field_private_notes: Private notes
config/locales/it.yml: permission_view_private_notes: View private notes
config/locales/sv.yml: field_private_notes: Privata anteckningar
config/locales/sv.yml: permission_view_private_notes: Visa privata anteckningar
config/locales/sl.yml: field_private_notes: Private notes
config/locales/sl.yml: permission_view_private_notes: View private notes
config/locales/uk.yml: field_private_notes: Private notes
config/locales/uk.yml: permission_view_private_notes: View private notes
config/locales/no.yml: field_private_notes: Private notes
config/locales/no.yml: permission_view_private_notes: View private notes
config/locales/es.yml: field_private_notes: Notas privadas
config/locales/es.yml: permission_view_private_notes: Ver notas privadas
config/locales/fi.yml: field_private_notes: Private notes
config/locales/fi.yml: permission_view_private_notes: View private notes
config/locales/de.yml: field_private_notes: Privater Kommentar
config/locales/de.yml: permission_view_private_notes: Private Kommentare sehen
config/locales/he.yml: field_private_notes: Private notes
config/locales/he.yml: permission_view_private_notes: View private notes
config/locales/ar.yml: field_private_notes: Private notes
config/locales/ar.yml: permission_view_private_notes: View private notes
config/locales/vi.yml: field_private_notes: Private notes
config/locales/vi.yml: permission_view_private_notes: View private notes
config/locales/ro.yml: field_private_notes: Private notes
config/locales/ro.yml: permission_view_private_notes: View private notes
config/locales/hr.yml: field_private_notes: Private notes
config/locales/hr.yml: permission_view_private_notes: View private notes
config/locales/ru.yml: field_private_notes: Приватный комментарий
config/locales/ru.yml: permission_view_private_notes: Просмотр приватных комментариев
config/locales/ca.yml: field_private_notes: Private notes
config/locales/ca.yml: permission_view_private_notes: View private notes
config/locales/bg.yml: field_private_notes: Лични бележки
config/locales/bg.yml: permission_view_private_notes: Разглеждане на лични бележки
config/locales/hu.yml: field_private_notes: Private notes
config/locales/hu.yml: permission_view_private_notes: View private notes
config/locales/zh.yml: field_private_notes: 私有注解
config/locales/zh.yml: permission_view_private_notes: 查看私有注解
config/locales/el.yml: field_private_notes: Private notes
config/locales/el.yml: permission_view_private_notes: View private notes
config/locales/fr.yml: field_private_notes: Notes privées
config/locales/fr.yml: permission_view_private_notes: Voir les notes privées
config/locales/en.yml: field_private_notes: Private notes
config/locales/en.yml: permission_view_private_notes: View private notes
config/locales/eu.yml: field_private_notes: Private notes
config/locales/eu.yml: permission_view_private_notes: View private notes
config/locales/et.yml: field_private_notes: Private notes
config/locales/et.yml: permission_view_private_notes: View private notes
config/locales/sq.yml: field_private_notes: Private notes
config/locales/sq.yml: permission_view_private_notes: View private notes
config/locales/da.yml: field_private_notes: Private notes
config/locales/da.yml: permission_view_private_notes: View private notes
config/locales/ja.yml: field_private_notes: プライベート注記
config/locales/ja.yml: permission_view_private_notes: プライベート注記の閲覧
config/locales/nl.yml: field_private_notes: Private notes
config/locales/nl.yml: permission_view_private_notes: View private notes
config/locales/sr.yml: field_private_notes: Private notes
config/locales/sr.yml: permission_view_private_notes: View private notes
config/locales/id.yml: field_private_notes: Private notes
config/locales/id.yml: permission_view_private_notes: View private notes
config/locales/tr.yml: field_private_notes: Private notes
config/locales/tr.yml: permission_view_private_notes: View private notes
config/locales/sr-YU.yml: field_private_notes: Private notes
config/locales/sr-YU.yml: permission_view_private_notes: View private notes
db/migrate/20120930112914_add_journals_private_notes.rb: add_column :journals, :private_notes, :boolean, :default => false, :null => false
db/migrate/20120930112914_add_journals_private_notes.rb: remove_column :journals, :private_notes
db/schema.rb: t.boolean "private_notes", :default => false, :null => false
lib/redmine/export/pdf.rb: title << " (#{l(:field_private_notes)})" if journal.private_notes?
lib/redmine/default_data/loader.rb: :view_private_notes,
lib/redmine.rb: map.permission :view_private_notes, {}, :read => true, :require => :member
test/fixtures/roles.yml: - :view_private_notes
test/functional/issues_controller_transaction_test.rb: journal = Journal.create!(:journalized => Issue.find(1), :notes => 'Privates notes', :private_notes => true, :user_id => 1)
test/functional/issues_controller_transaction_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/journals_controller_test.rb: journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Privates notes', :private_notes => true, :user_id => 1)
test/functional/journals_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/journals_controller_test.rb: journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Privates notes', :private_notes => true)
test/functional/journals_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/journals_controller_test.rb: journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Privates notes', :private_notes => true)
test/functional/journals_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/activities_controller_test.rb: def test_index_should_show_private_notes_with_permission_only
test/functional/activities_controller_test.rb: journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes with searchkeyword', :private_notes => true)
test/functional/activities_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/search_controller_test.rb: def test_search_issues_should_search_private_notes_with_permission_only
test/functional/search_controller_test.rb: Journal.create!(:journalized => Issue.find(2), :notes => 'Private notes with searchkeyword', :private_notes => true)
test/functional/search_controller_test.rb: Role.find(1).add_permission! :view_private_notes
test/functional/search_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/issues_controller_test.rb: def test_show_should_display_private_notes_with_permission_only
test/functional/issues_controller_test.rb: journal = Journal.create!(:journalized => Issue.find(2), :notes => 'Privates notes', :private_notes => true, :user_id => 1)
test/functional/issues_controller_test.rb: Role.find(1).remove_permission! :view_private_notes
test/functional/issues_controller_test.rb: put :update, :id => 1, :issue => {:notes => notes, :private_notes => '1'}
test/functional/issues_controller_test.rb: assert_equal true, j.private_notes
test/functional/issues_controller_test.rb: put :update, :id => 1, :issue => {:subject => 'New subject', :notes => notes, :private_notes => '1'}
test/functional/issues_controller_test.rb: assert_equal true, j.private_notes
test/functional/issues_controller_test.rb: assert_equal false, j.private_notes
test/unit/mailer_test.rb: def test_issue_edit_should_send_private_notes_to_users_with_permission_only
test/unit/mailer_test.rb: journal.private_notes = true
test/unit/mailer_test.rb: Role.find(2).add_permission! :view_private_notes
test/unit/mailer_test.rb: Role.find(2).remove_permission! :view_private_notes
test/unit/mailer_test.rb: def test_issue_edit_should_send_private_notes_to_watchers_with_permission_only
test/unit/mailer_test.rb: journal.private_notes = true
test/unit/mailer_test.rb: Role.non_member.add_permission! :view_private_notes
test/unit/mailer_test.rb: Role.non_member.remove_permission! :view_private_notes
test/unit/journal_test.rb: def test_create_should_not_split_non_private_notes
test/unit/journal_test.rb: def test_create_should_split_private_notes
test/unit/journal_test.rb: journal = Journal.generate!(:notes => 'Notes', :private_notes => true)
test/unit/journal_test.rb: assert_equal true, journal.private_notes
test/unit/journal_test.rb: journal = Journal.generate!(:notes => 'Notes', :private_notes => true, :details => [JournalDetail.new])
test/unit/journal_test.rb: assert_equal true, journal.private_notes
test/unit/journal_test.rb: assert_equal false, journal_with_changes.private_notes
test/unit/journal_test.rb: journal = Journal.generate!(:notes => '', :private_notes => true, :details => [JournalDetail.new])
test/unit/journal_test.rb: assert_equal false, journal.private_notes
test/unit/mail_handler_test.rb: assert_equal false, journal.private_notes
test/unit/mail_handler_test.rb: private_journal = Journal.create!(:notes => 'Private notes', :journalized => Issue.find(1), :private_notes => true, :user_id => 2)
test/unit/mail_handler_test.rb: assert_equal true, journal.private_notes
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
When I grep for "private_notes" I would expect to somewhere see:
"def private_notes?"
but I don't see that in the output. How is this possible? This is a brand new install, which I just downloaded from the Redmine site.
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
Also, for this error:
An error has occurred, all later migrations canceled:
undefined method `private_notes?' for #<Journal:0x00000006e97ab8>
Why is this not caught by method_missing? It looks like Redmine depended on method_missing to do some sort of meta-programming here?
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Jan Niggemann (redmine.org team member) over 11 years ago
tl;dr
Did you run the migration scripts (not the plugin migration)?
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
If I run this:
rake db:migrate RAILS_ENV=production
then I get this:
CreateChangesetParents: migrating =======================================-- create_table(:changeset_parents, {:id=>false})
rake aborted!
An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'changeset_parents' already exists: CREATE TABLE `changeset_parents` (`changeset_id` int(11) NOT NULL, `parent_id` int(11) NOT NULL) ENGINE=InnoDB
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/schema_statements.rb:170:in `create_table'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:434:in `create_table'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:466:in `block in method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:438:in `block in say_with_time'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:438:in `say_with_time'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:458:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:334:in `method_missing'
/home/lawrence/redmine-2.2/db/migrate/20110902000000_create_changeset_parents.rb:3:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:370:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:410:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:389:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:528:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:777:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:777:in `ddl_transaction'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:719:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:570:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/migration.rb:551:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:179:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p385/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
RE: ActionView::Template::Error (Mysql2::Error: Unknown column 'is_default' - Added by Lawrence Krubner over 11 years ago
A possible solution:
I deleted the table changeset_parents
This allowed me to run the db:migrate without errors.
I am not sure if the db is really upgraded, but at least I got past the errors.