move SiteText.{head,bottom} to SiteCustomization and remove redundant SiteText.top

This commit is contained in:
Régis Hanol
2015-01-12 19:59:43 +01:00
parent 03b053c800
commit 6ee2849df6
16 changed files with 92 additions and 43 deletions

View File

@@ -0,0 +1,23 @@
class MigrateSiteTextToSiteCustomization < ActiveRecord::Migration
def up
execute <<-SQL
INSERT INTO site_customizations
(name, user_id, enabled, key, created_at, updated_at, head_tag, body_tag)
VALUES (
'Migrated from Site Text',
-1,
't',
'#{SecureRandom.uuid}',
now(),
now(),
(SELECT value FROM site_texts WHERE text_type = 'top' LIMIT 1),
(SELECT value FROM site_texts WHERE text_type = 'bottom' LIMIT 1)
)
SQL
end
def down
end
end