Sha256: 60c954ee22cf7f016e53d47b1d55c8165d316fbdcd7e23ef905dbe0a00714b40

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

class <%= @migration_class_name %> < Dynomite::Migration
  def up
    create_table :<%= @table_name %> do |t|
      t.partition_key :<%= @partition_key %>
<% if @sort_key # so extra spaces are not added when generated -%>
      t.sort_key  "<%= @sort_key %>" # optional
<% end -%>
<% if %w[id id:string].include?(@partition_key) -%>
      t.add_gsi :updated_at
<% else %>
      t.add_gsi :id
<% end -%>
    end
  end
end

# More examples: https://v5.docs.rubyonjets.com/docs/database/dynamodb/migration/

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynomite-2.0.3 lib/dynomite/migration/templates/create_table.rb