mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
move SiteText.{head,top,bottom} to SiteCustomization
This commit is contained in:
@@ -11,7 +11,7 @@ class MigrateSiteTextToSiteCustomization < ActiveRecord::Migration
|
||||
'#{SecureRandom.uuid}',
|
||||
now(),
|
||||
now(),
|
||||
(SELECT value FROM site_texts WHERE text_type = 'top' LIMIT 1),
|
||||
(SELECT value FROM site_texts WHERE text_type = 'head' LIMIT 1),
|
||||
(SELECT value FROM site_texts WHERE text_type = 'bottom' LIMIT 1)
|
||||
)
|
||||
SQL
|
||||
|
||||
20
db/migrate/20150114093325_add_top_to_site_customization.rb
Normal file
20
db/migrate/20150114093325_add_top_to_site_customization.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
class AddTopToSiteCustomization < ActiveRecord::Migration
|
||||
def up
|
||||
add_column :site_customizations, :top, :text
|
||||
add_column :site_customizations, :mobile_top, :text
|
||||
|
||||
execute <<-SQL
|
||||
UPDATE site_customizations
|
||||
SET top = (SELECT value FROM site_texts WHERE text_type = 'top' LIMIT 1),
|
||||
mobile_top = (SELECT value FROM site_texts WHERE text_type = 'top' LIMIT 1),
|
||||
head_tag = (SELECT value FROM site_texts WHERE text_type = 'head' LIMIT 1),
|
||||
body_tag = (SELECT value FROM site_texts WHERE text_type = 'bottom' LIMIT 1)
|
||||
WHERE name = 'Migrated from Site Text'
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :site_customizations, :top
|
||||
remove_column :site_customizations, :mobile_top
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user