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

BigInt/Datatypes enhancements #673

Merged
merged 4 commits into from Jun 6, 2013

Conversation

3 participants
@sevastos
Contributor

sevastos commented Jun 4, 2013

Value omittion of autoincremental numerics
For a integer column with autoincrement the value can be omitted while supplying values for other columns.

However that only worked for integers, not for bigints and so you were getting error:
error: null value in column "id" violates not-null constraint

It should be fixed and a test was added to cover this case.

Enable the override of a datatype for autogenerated relation keys
By default autogenerated keys for relations have Integer datatype. Allowing BigInts will further increase the range of data.

@durango

View changes

spec/associations/has-many.spec.js Outdated
expect(Task.rawAttributes.userId.type.toString())
.toEqual(dataType.toString())
dataTypes.splice(dataTypes.indexOf(dataType), 1);

This comment has been minimized.

@durango

durango Jun 5, 2013

Member

Remove semi-colons please.

This comment has been minimized.

@sevastos

sevastos Jun 5, 2013

Contributor

Ah, sorry about that, checked and fixed the whole PR.

@durango

View changes

spec/associations/has-many.spec.js Outdated
.toEqual(dataType.toString())
dataTypes.splice(dataTypes.indexOf(dataType), 1);
if (!dataTypes.length) {

This comment has been minimized.

@durango

durango Jun 5, 2013

Member

Why not..

expect(dataTypes.length).toBeGreaterThan(0)
done()

?

This comment has been minimized.

@sevastos

sevastos Jun 5, 2013

Contributor

The scenario loops through 3 different dataTypes and creates associations based on those. Having the loop wrap the async operation of the table creation means we have to wait all the dataTypes cases to finish before done() can be called. Otherwise done() will be called multiple times.

@sevastos

This comment has been minimized.

Contributor

sevastos commented Jun 5, 2013

Some stuff changed on master, looking into it.

dataTypes.splice(dataTypes.indexOf(dataType), 1)
if (!dataTypes.length) {
done()
}

This comment has been minimized.

@sevastos

sevastos Jun 5, 2013

Contributor

The scenario loops through 3 different dataTypes and creates associations based on those. Having the loop wrap the async operation of the table creation means we have to wait all the dataTypes cases to finish before done() can be called. Otherwise done() will be called multiple times.

This comment has been minimized.

@durango

durango Jun 5, 2013

Member

Oh you're right you're right, I quickly glanced at the code and initially saw it outside of the .forEach loop, sorry :)

This comment has been minimized.

@sevastos

sevastos Jun 5, 2013

Contributor

:) np

@sdepold

This comment has been minimized.

Member

sdepold commented Jun 6, 2013

@durango: is that good to go? if so: feel free to merge :)

durango added a commit that referenced this pull request Jun 6, 2013

Merge pull request #673 from sevastos/value-omittion-of-autoincrement…
…al-numerics

BigInt/Datatypes enhancements

@durango durango merged commit 7df9fcb into sequelize:master Jun 6, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment