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

pg driver and specificType #118

Closed
aidenbell opened this issue Dec 1, 2013 · 2 comments
Closed

pg driver and specificType #118

aidenbell opened this issue Dec 1, 2013 · 2 comments
Labels

Comments

@aidenbell
Copy link
Contributor

@aidenbell aidenbell commented Dec 1, 2013

When using pg driver, table.specificType causes a crash building the table with:

{ '0': [TypeError: Property 'typeSpecific' of object # is not a function] }

The call was:

t.specificType('geom', 'GEOMETRY(Point, 26910)');

@aidenbell
Copy link
Contributor Author

@aidenbell aidenbell commented Dec 1, 2013

When info:

   '--- Caused by reason ---',
   'TypeError: Property \'typeSpecific\' of object #<Object> is not a function',
   '    at Object.exports.baseSchemaGrammar.getType (/node_modules/bookshelf/node_modules/knex/clients/base/schemagrammar.js:135:60)',
   '  ...[filtered frames]...',
   '    at Object.exports.baseSchemaGrammar.getColumns (/node_modules/bookshelf/node_modules/knex/clients/base/schemagrammar.js:115:50)',
   '    at Object.exports.baseSchemaGrammar.compileCreateTable (/node_modules/bookshelf/node_modules/knex/clients/base/schemagrammar.js:180:26)',
   '    at Object.exports.baseSchemaGrammar.toSql (/node_modules/bookshelf/node_modules/knex/clients/base/schemagrammar.js:79:33)',
   '    at exports.Common.toSql (/node_modules/bookshelf/node_modules/knex/lib/common.js:82:27)',
   '    at ClientBase.extend.query (/node_modules/bookshelf/node_modules/knex/clients/server/base.js:37:30)',
   '    at exports.Common.then (/node_modules/bookshelf/node_modules/knex/lib/common.js:59:53)',
   '    at schema.js:98:6' ] } ]
@aidenbell
Copy link
Contributor Author

@aidenbell aidenbell commented Dec 1, 2013

Issue seems to be:

https://github.com/tgriesser/knex/blob/3c8d08a64b3014cad237baec0f9cb023cb66bd73/lib/schemabuilder.js#L262

String 'specific' should be 'specificType'.

Running:

t._addColumn('specificType', 'geom', {
            specific: 'GEOMETRY(Point, 26910)'
        });

Manually adds the correct column.

tgriesser added a commit that referenced this issue Dec 2, 2013
Proposed fix for #118
@tgriesser tgriesser closed this Dec 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants