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.0.7 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.6 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.5 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.4 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.3 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.2 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.1 vendor/dynomite/docs/migrations/short-example.rb
jets-1.0.0 vendor/dynomite/docs/migrations/short-example.rb
jets-0.10.4 vendor/dynomite/docs/migrations/short-example.rb
jets-0.10.3 vendor/dynomite/docs/migrations/short-example.rb
jets-0.10.2 vendor/dynomite/docs/migrations/short-example.rb
jets-0.10.1 vendor/dynomite/docs/migrations/short-example.rb
jets-0.10.0 vendor/dynomite/docs/migrations/short-example.rb
jets-0.9.2 vendor/dynomite/docs/migrations/short-example.rb
jets-0.9.1 vendor/dynomite/docs/migrations/short-example.rb
jets-0.9.0 vendor/dynomite/docs/migrations/short-example.rb
jets-0.8.18 vendor/dynomite/docs/migrations/short-example.rb
jets-0.8.17 vendor/dynomite/docs/migrations/short-example.rb
jets-0.8.15 vendor/dynomite/docs/migrations/short-example.rb
jets-0.8.14 vendor/dynomite/docs/migrations/short-example.rb