diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-10-04 19:19:15 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-10-04 19:19:15 +0000 |
commit | 9fc669a8880a38dbabb373d1a0303ef10f3ea0f6 (patch) | |
tree | a9fb5a8db92de6310d45d6c4e35ffa8bb6dc31f2 /db | |
parent | ba635eace99f8552c3364d6b86b07043147c2dac (diff) | |
download | redmine-9fc669a8880a38dbabb373d1a0303ef10f3ea0f6.tar.gz redmine-9fc669a8880a38dbabb373d1a0303ef10f3ea0f6.zip |
Make common_mark the default text formatting for new installations (#34863).
git-svn-id: https://svn.redmine.org/redmine/trunk@21897 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/017_create_settings.rb | 4 | ||||
-rw-r--r-- | db/migrate/20221004172825_ensure_text_formatting_setting_is_stored_in_db.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/017_create_settings.rb b/db/migrate/017_create_settings.rb index 777e36ed6..4c18329cc 100644 --- a/db/migrate/017_create_settings.rb +++ b/db/migrate/017_create_settings.rb @@ -4,6 +4,10 @@ class CreateSettings < ActiveRecord::Migration[4.2] t.column "name", :string, :limit => 30, :default => "", :null => false t.column "value", :text end + + # Persist text_formatting default setting for new installations + setting = Setting.new(:name => "text_formatting", :value => Setting.text_formatting) + setting.save! end def self.down diff --git a/db/migrate/20221004172825_ensure_text_formatting_setting_is_stored_in_db.rb b/db/migrate/20221004172825_ensure_text_formatting_setting_is_stored_in_db.rb new file mode 100644 index 000000000..bcb8130bb --- /dev/null +++ b/db/migrate/20221004172825_ensure_text_formatting_setting_is_stored_in_db.rb @@ -0,0 +1,8 @@ +class EnsureTextFormattingSettingIsStoredInDb < ActiveRecord::Migration[6.1] + def change + unless Setting.where(name: "text_formatting").exists? + setting = Setting.new(:name => "text_formatting", :value => 'textile') + setting.save! + end + end +end |