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

Indexes Using columns not quoted #47

Open
toddpi314 opened this issue Aug 25, 2014 · 0 comments
Open

Indexes Using columns not quoted #47

toddpi314 opened this issue Aug 25, 2014 · 0 comments

Comments

@toddpi314
Copy link

If you have a case-sensitive model attribute and create a mutli-column index like this:

var User = schema.define('User', {
    userId: {
        type: Number
    },
    messageId: {
        type: Number
    }
}, {
    indexes: {
        indexPrimary: {
            columns: 'userId,messageId',
            type: 'btree'
        }
    }
});

The constructed sql doesn't wrap the column names for the btree's Using context:

CREATE  INDEX "indexPrimary" ON "User" USING btree (userId,messageId)

This will result in something like "Cannot find column 'userid'" failure.

Workaround (manually adding the quotes inline):

        indexPrimary: {
            columns: '"userId","messageId"',
            type: 'btree'
        }

I am guessing that this should be handled in the library itself, as it does this for single columns perfectly.

Thanks for the hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant