Skip to content

Adding an index creates two tables #143

@andreimarinescu

Description

@andreimarinescu

I'm trying to work with a table with four fields, similar to the example below:

class Logging
    include Dynamoid::Document
    table :name => :api_calls
    range :stamp, :integer
    field :appId, :integer
    field :function
    field :stamp, :integer
    field :version, :integer
    index :appId

When I use the table without the index directive, everything works ok (but running a query against appId uses scanning, even if I create the table with the index in AWS console beforehand).

When running it with the index directive, Dynamoid creates a table called index_api_calls_appIds and the insert fails with ArgumentError: a range key value is required for this table.

What am I doing wrong? I'm running Rails 3.2.13 and aws-sdk 1.11.1 (same problem with 1.8.6) and the latest official rubygem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions