diff --git a/db/migrate/20190908234054_migrate_post_edit_time_limit.rb b/db/migrate/20190908234054_migrate_post_edit_time_limit.rb new file mode 100644 index 00000000000..cd84b391f9e --- /dev/null +++ b/db/migrate/20190908234054_migrate_post_edit_time_limit.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class MigratePostEditTimeLimit < ActiveRecord::Migration[5.2] + def up + execute <<~SQL + INSERT INTO site_settings ( + name, + value, + data_type, + created_at, + updated_at + ) + SELECT + 'tl2_post_edit_time_limit', + value, + data_type, + CURRENT_TIMESTAMP, + CURRENT_TIMESTAMP + FROM site_settings + WHERE + name = 'post_edit_time_limit' + ON CONFLICT + DO NOTHING + SQL + end +end