fix plugin ckeditor db migration

This commit is contained in:
linchun 2014-08-01 22:29:52 +08:00
parent d66dc65cca
commit ab2d92315e
1 changed files with 18 additions and 0 deletions

View File

@ -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