Sha256: 0a49beed587c7148265f07e58f49caf04e0a5f62b47c818004a7efcaa8d855d4
Contents?: true
Size: 878 Bytes
Versions: 6
Compression:
Stored size: 878 Bytes
Contents
# This migration comes from pulitzer (originally 20151029220558) class ChangePostElementsToVersions < ActiveRecord::Migration def up rename_column :pulitzer_content_elements, :post_id, :version_id rename_column :pulitzer_post_tags, :post_id, :version_id Pulitzer::ContentElement.reset_column_information Pulitzer::PostTag.reset_column_information # Clone post content elements and clone tags, and assign them to the new version Pulitzer::Post.find_each do |post| version = post.create_preview_version Pulitzer::ContentElement.where(version_id: post.id).update_all(version_id: version.id) Pulitzer::PostTag.where(version_id: post.id).update_all(version_id: version.id) end end def down rename_column :pulitzer_content_elements, :version_id, :post_id rename_column :pulitzer_post_tags, :version_id, :post_id end end
Version data entries
6 entries across 6 versions & 1 rubygems