Sha256: 108275c7b5337cabc49e94b4addcb2989b8ecc178ffe3d588a55db793cc1bf4b

Contents?: true

Size: 545 Bytes

Versions: 3

Compression:

Stored size: 545 Bytes

Contents

class BlogAddAttachmentsToArticleMigration < Migration
  def self.up(site)
    site.articles.modify do |articles|
      add_field :attachment, :attachment
      remove_field :blog
    end
    
    site.blogs.modify do |articles|
      remove_field :blog
    end
  end
  
  def self.down(site)
    site.pages.create_model :articles do |articles|
      add_field :blog, :alias, of: :parent
      remove_field :attachment
    end
    
    site.blogs.create_model :articles do |articles|
      add_field :blog, :alias, of: :parent
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yodel_blog-0.0.7 lib/migrations/04_add_attachment_to_article.rb
yodel_blog-0.0.4 lib/migrations/04_add_attachment_to_article.rb
yodel_blog-0.0.2 lib/migrations/04_add_attachment_to_article.rb