Sha256: b88a4f1cb2746921f8ceb53df8cf666cad245ace382d947736deadc1b650f08f

Contents?: true

Size: 434 Bytes

Versions: 30

Compression:

Stored size: 434 Bytes

Contents

class AddPublishedAtToContent < ActiveRecord::Migration
  class Content < ActiveRecord::Base
    include BareMigration
  end

  def self.up
    modify_tables_and_update(:add_column, Content,
                             :published_at, :datetime) do |content|
      unless $schema_generator
        content.published_at = content.created_at
      end
    end
  end

  def self.down
    remove_column :contents, :published_at
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
typo-5.5 db/migrate/044_add_published_at_to_content.rb
typo-5.4.4 db/migrate/044_add_published_at_to_content.rb
typo-5.4.3 db/migrate/044_add_published_at_to_content.rb
typo-5.4.2 db/migrate/044_add_published_at_to_content.rb
typo-5.4.1 db/migrate/044_add_published_at_to_content.rb
typo-5.4 db/migrate/044_add_published_at_to_content.rb
typo-3.99.0 db/migrate/044_add_published_at_to_content.rb
typo-3.99.1 db/migrate/044_add_published_at_to_content.rb
typo-3.99.2 db/migrate/044_add_published_at_to_content.rb
typo-3.99.3 db/migrate/044_add_published_at_to_content.rb
typo-3.99.4 db/migrate/044_add_published_at_to_content.rb
typo-4.0.0 db/migrate/044_add_published_at_to_content.rb
typo-4.0.2 db/migrate/044_add_published_at_to_content.rb
typo-4.0.1 db/migrate/044_add_published_at_to_content.rb
typo-4.0.3 db/migrate/044_add_published_at_to_content.rb
typo-4.1.1 db/migrate/044_add_published_at_to_content.rb
typo-4.1 db/migrate/044_add_published_at_to_content.rb
typo-5.0.2 db/migrate/044_add_published_at_to_content.rb
typo-5.0.1 db/migrate/044_add_published_at_to_content.rb
typo-5.0.3.98.1 db/migrate/044_add_published_at_to_content.rb