Sha256: 4032e577ae8ce143837eb367667c69ddba9bf1f7b6a10ab905f8fdff9fa28e1a

Contents?: true

Size: 440 Bytes

Versions: 13

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

class AddPublishedAtToDecidimBlogsPosts < ActiveRecord::Migration[6.1]
  class Post < ApplicationRecord
    self.table_name = :decidim_blogs_posts
  end

  def change
    add_column :decidim_blogs_posts, :published_at, :datetime

    reversible do |direction|
      direction.up do
        Post.update_all("published_at = created_at") # rubocop:disable Rails/SkipsModelValidations
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-blogs-0.29.1 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.4 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.29.0 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.3 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.29.0.rc4 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.29.0.rc3 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.29.0.rc2 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.29.0.rc1 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.2 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.1 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.0 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.0.rc5 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb
decidim-blogs-0.28.0.rc4 db/migrate/20220812122940_add_published_at_to_decidim_blogs_posts.rb