Sha256: 63f0e31eb7b4ce92e470bdba3bd7444de35416064f09bc6b002425386fdc8c36

Contents?: true

Size: 954 Bytes

Versions: 2

Compression:

Stored size: 954 Bytes

Contents

class CreateTranslationCenterTranslations < ActiveRecord::Migration
  def change
    # if mysql
    if defined?(ActiveRecord::ConnectionAdapters::Mysql2Adapter).present? && ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::Mysql2Adapter)
      
      create_table :translation_center_translations, options: 'CHARACTER SET=utf8' do |t|
        t.integer :translation_key_id
        t.string :value
        t.string :lang
        t.references :translator, polymorphic: true
        t.string :status, default: 'pending'

        t.timestamps
      end

    else

      create_table :translation_center_translations do |t|
        t.integer :translation_key_id
        t.string :value
        t.string :lang
        t.references :translator, polymorphic: true
        t.string :status, default: 'pending'

        t.timestamps
      end      

    end

    add_index :translation_center_translations, :translation_key_id
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
translation_center-1.6.9 lib/generators/translation_center/install/templates/migrations/create_translation_center_translations.rb
translation_center-1.6.8 lib/generators/translation_center/install/templates/migrations/create_translation_center_translations.rb