Sha256: 76df2695742c175456a789e94d513957ee09a96f747253cfded73fd0a57395b3

Contents?: true

Size: 683 Bytes

Versions: 8

Compression:

Stored size: 683 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :<%= lang_table_name %> do |t|
      t.string  :code, null: false, limit: 5
      t.boolean :east, null: false, default: false
      t.integer :position , default: 1  , null: false
      t.boolean :enable, null: false, default: true
      t.timestamps
    end
    add_index :<%= lang_table_name %>, [:code], unique: true

    create_table :<%= lang_text_table_name %> do |t|
      t.integer :parent_id, null: false
      t.integer :lang_id, null: false
      t.string  :label
      t.timestamps
    end
    add_index :<%= lang_text_table_name %>, [:parent_id,:lang_id], unique: true
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
activerecord-mlang-0.0.9 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.8 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.7 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.6 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.5 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.4 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.3 lib/generators/active_record/templates/migration.rb
activerecord-mlang-0.0.2 lib/generators/active_record/templates/migration.rb