lib/will_translate/schema.rb
# Adds wt_translations table to database unless it already exists
Adds wt_translations table to database unless it already exists
Adds wt_translations table to database unless it already exists
def add_will_translate
        unless ActiveRecord::Base.connection.table_exists? 'wt_translation'
          create_table :wt_translations do |t|
            t.string    :translateable_type,    :limit => 32,   :null => false
            t.integer   :translateable_id,                      :null => false
            t.string    :locale,                :limit => 8,    :null => false
            t.string    :field,                 :limit => 32,   :null => false
            t.text      :content
          end
          add_index :wt_translations, [ :translateable_type, :translateable_id, :locale, :field ], :unique => true, :name => 'lookup'
        end
      end
def add_will_translate unless ActiveRecord :: Base . connection . table_exists? 'wt_translation' create_table :wt_translations do | t | t . string :translateable_type , :limit => 32 , :null => false t . integer :translateable_id , :null => false t . string :locale , :limit => 8 , :null => false t . string :field , :limit => 32 , :null => false t . text :content end add_index :wt_translations , [ :translateable_type , :translateable_id , :locale , :field ] , :unique => true , :name => 'lookup' end end
Adds wt_translations table to database unless it already exists
Adds wt_translations table to database unless it already exists