Sha256: 8286793ce3d8cc1f7811c66f3fffbdf432e9c9b5358d2cc7065429965fa48d53

Contents?: true

Size: 689 Bytes

Versions: 66

Compression:

Stored size: 689 Bytes

Contents

class RocketCmsCreateNews < ActiveRecord::Migration
  def change
    create_table :news do |t|
      t.boolean :enabled, default: true, null: false
      t.timestamp :time, null: false

      if RocketCMS.config.localize
        t.column :name_translations, 'hstore', default: {}
        t.column :excerpt_translations, 'hstore', default: {}
        t.column :content_translations, 'hstore', default: {}
      else
        t.string :name, null: false
        t.text :excerpt
        t.text :content
      end

      t.string :slug, null: false
      t.attachment :image
      t.timestamps
    end

    add_index :news, :slug, unique: true
    add_index :news, [:enabled, :time]
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
rocket_cms-0.17.2 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.17.1 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.17.0 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.16.1 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.16.0 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.5 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.4 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.3 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.2 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.1 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.15.0 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.14.0 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.6 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.5 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.4 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.3 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.2 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.1 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.13.0 lib/generators/rocket_cms/templates/migration_news.rb
rocket_cms-0.12.3 lib/generators/rocket_cms/templates/migration_news.rb