Sha256: 03043bdb0ec50ccd8053ad22a839dcc9f9daf0ff5a1ec1d0d3962e786d0ae138
Contents?: true
Size: 1.01 KB
Versions: 31
Compression:
Stored size: 1.01 KB
Contents
class CommentsMigration < Dynomite::Migration def up create_table :comments do |t| t.partition_key "post_id:string" # required t.sort_key "created_at:string" # optional t.provisioned_throughput(5) # sets both read and write, defaults to 5 when not set # Instead of using partition_key and sort_key you can set the # key schema directly also # t.key_schema([ # {attribute_name: "id", :key_type=>"HASH"}, # {attribute_name: "created_at", :key_type=>"RANGE"} # ]) # t.attribute_definitions([ # {attribute_name: "id", attribute_type: "N"}, # {attribute_name: "created_at", attribute_type: "S"} # ]) # other ways to set provisioned_throughput # t.provisioned_throughput(:read, 10) # t.provisioned_throughput(:write, 10) # t.provisioned_throughput( # read_capacity_units: 5, # write_capacity_units: 5 # ) end end end # More examples: https://github.com/tongueroo/dynomite/tree/master/docs
Version data entries
31 entries across 31 versions & 1 rubygems