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

table.id doesn't get autoincrement nor primary key value #4

Closed
ghost opened this issue Mar 31, 2011 · 1 comment
Closed

table.id doesn't get autoincrement nor primary key value #4

ghost opened this issue Mar 31, 2011 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 31, 2011

When creating a model with an 'id' row, this doesn't function as an autoincrement row. Therefore, inserting a record without any mention of 'id' in the model writes a NULL to the db instead of an incremented id.

@ghost
Copy link
Author

ghost commented Mar 31, 2011

Solved it; instead of only 'INTEGER' you should add 'AUTOINCREMENT' as well. Maybe the documentation should be updated with this?

var searches = new joli.model({
 table:    'searches',
 columns:  {
   id: 'INTEGER PRIMARY KEY AUTOINCREMENT',
   name: 'TEXT',
 }
});

@ghost ghost closed this as completed May 1, 2011
This issue was closed.
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

0 participants