Blame view

db/migrate/20100831193450_add_thumbnails_processed_to_articles.rb 558 Bytes
b5ffea8f   Daniela Feitosa   Upload of files d...
1
2
3
4
class AddThumbnailsProcessedToArticles < ActiveRecord::Migration
  def self.up
     add_column :articles, :thumbnails_processed, :boolean, :default => false
     add_column :article_versions, :thumbnails_processed, :boolean, :default => false
02217397   Antonio Terceiro   Fix migration
5
6
7

     # the pre-existing images already had their thumbnails created before!
     execute("update articles set thumbnails_processed = (1>0) where type = 'UploadedFile'")
b5ffea8f   Daniela Feitosa   Upload of files d...
8
9
10
11
12
13
14
  end

  def self.down
     remove_column :articles, :thumbnails_processed
     remove_column :article_versions, :thumbnails_processed
  end
end