Sha256: b54f223c3fe29aa7a50db60ee15845f308580f33cec7ef25cce960d18ce212d6
Contents?: true
Size: 1.05 KB
Versions: 8
Compression:
Stored size: 1.05 KB
Contents
class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>] def change create_table :<%= table_name %><%= primary_key_type %> do |t| # Translated attribute(s) <% attributes.each do |attribute| -%> <% if attribute.token? -%> t.string :<%= attribute.name %><%= attribute.inject_options %> <% else -%> t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %> <% end -%> <% end -%> t.string :locale, null: false t.integer :<%= foreign_key %>, null: false t.timestamps null: false end add_index :<%= table_name %>, :<%= foreign_key %>, name: :<%= translation_index_name %> add_index :<%= table_name %>, :locale, name: :<%= translation_locale_index_name %> add_index :<%= table_name %>, [:<%= foreign_key %>, :locale], name: :<%= translation_unique_index_name %>, unique: true <%- attributes_with_index.each do |attribute| -%> add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %> <%- end -%> end end
Version data entries
8 entries across 8 versions & 1 rubygems