Sha256: e012a2d43d941b6a072bd1215805db224bacd27a412a61b7a08b6e32a8e33222

Contents?: true

Size: 878 Bytes

Versions: 96

Compression:

Stored size: 878 Bytes

Contents

class CreateCommentsMigration < 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

      t.lsi do |i|
        i.partition_key "user_id:string"
        i.sort_key "updated_at:string" # optional

        i.provisioned_throughput(10)
      end
    end
  end
end

class UpdateCommentsMigration < Dynomite::Migration
  def up
    update_table :comments do |t|
      t.gsi(:create) do |i|
        i.partition_key "post_id:string"
        i.sort_key "updated_at:string" # optional

        i.provisioned_throughput(10)
      end

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

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

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
jets-1.4.9 vendor/dynomite/docs/migrations/short-example.rb
dynomite-1.0.9 docs/migrations/short-example.rb
jets-1.4.8 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.7 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.6 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.5 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.4 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.3 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.2 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.1 vendor/dynomite/docs/migrations/short-example.rb
jets-1.4.0 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.9 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.8 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.7 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.6 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.5 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.4 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.3 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.2 vendor/dynomite/docs/migrations/short-example.rb
jets-1.3.1 vendor/dynomite/docs/migrations/short-example.rb