Sha256: 0585798ac45d264505dd8d243eecade6d2af953c23904181f46355c94e9723a1

Contents?: true

Size: 743 Bytes

Versions: 107

Compression:

Stored size: 743 Bytes

Contents

class <%= @migration_class_name %> < Dynomite::Migration
  def up
    update_table :<%= @table_name %> do |t|
      t.gsi(:create) do |i|
        i.partition_key "<%= @partition_key %>" # required
<% if @sort_key # so extra spaces are not added when generated -%>
        t.sort_key  "<%= @sort_key %>" # optional
<% end -%>

        i.provisioned_throughput(5)
      end

      # Examples:
      # t.gsi(:update, "update-me-index") do |i|
      #   i.provisioned_throughput(10)
      # end

      # t.gsi(:delete, "delete-me-index")

      # Must use :create, :update, :delete one at a time in separate migration files.
      # DynamoDB imposes this.
    end
  end
end

# More examples: https://github.com/tongueroo/dynomite/tree/master/docs

Version data entries

107 entries across 107 versions & 2 rubygems

Version Path
dynomite-1.2.7 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.6 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.5 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.4 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.3 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.2 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.1 lib/dynomite/migration/templates/update_table.rb
dynomite-1.2.0 lib/dynomite/migration/templates/update_table.rb
dynomite-1.1.1 lib/dynomite/migration/templates/update_table.rb
jets-1.4.10 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
dynomite-1.1.0 lib/dynomite/migration/templates/update_table.rb
jets-1.4.9 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
dynomite-1.0.9 lib/dynomite/migration/templates/update_table.rb
jets-1.4.8 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.7 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.6 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.5 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.4 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.3 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb
jets-1.4.2 vendor/dynomite/lib/dynomite/migration/templates/update_table.rb