Sha256: e3fcc69119942573d15f6b658aa233b8599c510629a018793dae31f980800178

Contents?: true

Size: 1.41 KB

Versions: 2

Compression:

Stored size: 1.41 KB

Contents

class BaseTranslations < ActiveRecord::Migration[5.2]
  def change
    create_table :static_page_translations do |t|
      t.references :static_page, null: false
      t.string :locale, limit: 5, null: false
      t.string :title
      t.text :content

      t.timestamps
    end
    add_index :static_page_translations, [:static_page_id, :locale], unique: true, name: 'static_pages_ts_static_page_id_locale'

    create_table :header_translations do |t|
      t.references :header, null: false
      t.string :locale, limit: 5, null: false
      t.string :title
      t.string :h1
      t.string :keywords
      t.text :description
      t.text :seo_block

      t.timestamps
    end
    add_index :header_translations, [:header_id, :locale], unique: true, name: 'headers_ts_header_id_locale'

    create_table :structure_translations do |t|
      t.references :structure, null: false
      t.string :locale, limit: 5, null: false
      t.string :title
      t.string :redirect_url

      t.timestamps
    end
    add_index :structure_translations, [:structure_id, :locale], unique: true, name: 'structures_ts_structure_id_locale'

    create_table :asset_translations do |t|
      t.references :asset, null: false
      t.string :locale, limit: 5, null: false
      t.string :name
      t.string :alt

      t.timestamps
    end
    add_index :asset_translations, [:asset_id, :locale], unique: true, name: 'assets_ts_asset_id_locale'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ab_admin-0.11.0 db/migrate/20130101000007_base_translations.rb
ab_admin-0.10.0 db/migrate/20130101000007_base_translations.rb