You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/db/migrate/20160222064143_add_publish_...

22 lines
588 B

class AddPublishToAttachments < ActiveRecord::Migration
def change
add_column :attachments, :is_publish, :integer, :default => 1
add_column :attachments, :publish_time, :date
=begin
count = Attachment.all.count / 30 + 2
transaction do
for i in 1 ... count do i
Attachment.page(i).per(30).each do |atta|
begin
atta.publish_time = atta.created_on.strftime('%d-%b-%Y')
atta.save
ensure
logger.error("===================>>container_id is null")
end
end
end
end
=end
end
end