Sha256: 047d0c4ffb870d1d0e2d1c813cb5921cf57511ee5ec3d7df080190354031df89

Contents?: true

Size: 681 Bytes

Versions: 27

Compression:

Stored size: 681 Bytes

Contents

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

      if Enjoy.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

27 entries across 27 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.7.3 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.7.2 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.7.1 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.7 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.6.2 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.6.1 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.6 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.5 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.4 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.3 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.2.1 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.2 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.1.2 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.1.1 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.1 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.0.4 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.0.3 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.3.0.2 lib/generators/enjoy/templates/migration_news.rb
enjoy_cms-0.2.1 lib/generators/enjoy/templates/migration_news.rb