Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle tables that don't use the default primary key field name id #3

Open
internalfx opened this issue Jan 5, 2015 · 2 comments
Open
Assignees

Comments

@internalfx
Copy link
Owner

Handle tables that don't use the default primary key field name id, you can retrieve the primary key of the source table through r.db(sourceDb).table(table).info()('primary_key') and pass it into the tableCreate call through the primaryKey opt arg.

@thinklinux
Copy link

@internalfx Is that fixed for the sync command? I tried to sync two dbs and that's the error I'm getting:

{ ReqlOpFailedError: Index `id` was not found on table `db.table` in:
r.db("db").table("table").orderBy({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    index: r.asc("id")
    ^^^^^^^^^^^^^^^^^^
}).map(function(var_6) {
^^^^^^^^^^^^^^^^^^^^^^^^
    return {
    ^^^^^^^^
        id: var_6("id"),
        ^^^^^^^^^^^^^^^^
        hash: r.uuid(var_6.toJSON())
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    }
    ^
})
^^

@internalfx
Copy link
Owner Author

@thinklinux 😦

I'm guessing no.....and I will have another look.

Thanks for reporting.

@internalfx internalfx reopened this Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants