Sha256: 5a5e6d81daf245143b0a619cbddd0a58ab00030e340e15fdfafddb5290f8cb45
Contents?: true
Size: 838 Bytes
Versions: 8
Compression:
Stored size: 838 Bytes
Contents
class AssociateThemeCustomizationsWithSites < ActiveRecord::Migration[5.2] def up add_reference(:pageflow_theme_customizations, :site) execute(<<-SQL) UPDATE pageflow_theme_customizations LEFT JOIN pageflow_accounts ON pageflow_accounts.id = pageflow_theme_customizations.account_id SET site_id = pageflow_accounts.default_site_id; SQL remove_reference(:pageflow_theme_customizations, :account) end def down add_reference(:pageflow_theme_customizations, :account) execute(<<-SQL) UPDATE pageflow_theme_customizations LEFT JOIN pageflow_sites ON pageflow_sites.id = pageflow_theme_customizations.site_id SET pageflow_theme_customizations.account_id = pageflow_sites.account_id; SQL remove_reference(:pageflow_theme_customizations, :site) end end
Version data entries
8 entries across 8 versions & 1 rubygems