Sha256: cca0667d08ceb0964c9c1fbd51cd844eebc38cadcef4454c76d8dd1037774cd3

Contents?: true

Size: 1.42 KB

Versions: 1

Compression:

Stored size: 1.42 KB

Contents

class HancockCreateSeos < ActiveRecord::Migration
  def change
    ############## SEO ###################33
    create_table :hancock_seo_seos do |t|
      t.boolean :enabled, default: true, null: false
      t.integer :seoable_id
      t.string  :seoable_type

      if Hancock::Seo.config.localize
        t.column :h1_translations, 'hstore', default: {}
        t.column :title_translations, 'hstore', default: {}
        t.column :keywords_translations, 'hstore', default: {}
        t.column :description_translations, 'hstore', default: {}
        t.column :og_title_translations, 'hstore', default: {}
      else
        t.string :h1
        t.string :title
        t.text :keywords
        t.text :description
        t.string :og_title
      end
      t.string :robots
      t.attachment :og_image

      t.timestamps
    end

    add_index :hancock_seo_seos, [:seoable_id, :seoable_type], unique: true



    ################# SITEMAP #####################
    create_table :hancock_seo_sitemap_data do |t|
      t.boolean :enabled, default: true, null: false
      t.integer :sitemap_data_field_id
      t.string  :sitemap_data_field_type

      t.boolean :sitemap_show, default: true, null: false
      t.timestamps :sitemap_lastmod
      t.string :sitemap_changefreq
      t.float :sitemap_priority

      t.timestamps
    end

    add_index :hancock_seo_sitemap_data, [:sitemap_data_field_id, :sitemap_data_field_type], unique: true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_seo-1.0.2 lib/generators/hancock/seo/migrations/templates/migration_seos.rb