From ab2d92315e8c5b0afd88b552df654c66c3301103 Mon Sep 17 00:00:00 2001 From: linchun Date: Fri, 1 Aug 2014 22:29:52 +0800 Subject: [PATCH] fix plugin ckeditor db migration --- .../20130418001210_add_ckeditor_to_settings.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb diff --git a/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb b/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb new file mode 100644 index 000000000..8fd452093 --- /dev/null +++ b/plugins/redmine_ckeditor/db/migrate/20130418001210_add_ckeditor_to_settings.rb @@ -0,0 +1,18 @@ +# This migration comes from rich (originally 20111201095829) +class AddCkeditorToSettings < ActiveRecord::Migration + def up + str = " +insert into `settings` (`name`, `value`, `updated_on`) values('plugin_redmine_ckeditor','--- !ruby/hash:ActiveSupport::HashWithIndifferentAccess\nskin: kama\nui_color: ! \'#f4f4f4\'\nwidth: \'\'\nheight: \'400\'\nenter_mode: \'1\'\nshow_blocks: \'1\'\ntoolbar_can_collapse: \'0\'\ntoolbar_location: top\ntoolbar: Source,ShowBlocks,--,Undo,Redo,-,Find,Replace,--,Bold,Italic,Underline,Strike,-,Subscript,Superscript,-,NumberedList,BulletedList,-,Outdent,Indent,Blockquote,-,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,-,Link,Unlink,-,richImage,Table,HorizontalRule,/,Styles,Format,Font,FontSize,-,TextColor,BGColor,Cut,Copy,Paste,BidiLtr,BidiRtl,PasteText,PasteFromWord,RemoveFormat,SelectAll\n','2014-07-24 11:24:50'); + " + ActiveRecord::Base.connection.execute( + "insert settings(name, value) values('plugin_redmine_ckeditor', '')" + ) + end + + def down + ss = Setting.where("name='plugin_redmine_ckeditor'") + ss.each do |s| + s.destroy + end + end +end