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

Fix postgresql integer columns #52

Merged
merged 1 commit into from
Feb 24, 2013
Merged

Fix postgresql integer columns #52

merged 1 commit into from
Feb 24, 2013

Conversation

dxg
Copy link
Collaborator

@dxg dxg commented Feb 24, 2013

Version: 2.0.2, Database: PostgreSQL

db.define('house', {
  toiletCount: { type: 'number', rational: false }
}).sync();

executes:

CREATE TABLE "house"(
 "id"               SERIAL PRIMARY KEY,
 "toiletCount"  NUMERIC(0)
);

which results in:
ERROR: NUMERIC precision 0 must be between 1 and 1000

INTEGER is a much better choice; From the PostgreSQL docs:

...arithmetic on numeric values is very slow compared to the integer types...

@dresende
Copy link
Owner

Thank you :)

dresende added a commit that referenced this pull request Feb 24, 2013
@dresende dresende merged commit b0d4627 into dresende:master Feb 24, 2013
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

Successfully merging this pull request may close these issues.

2 participants