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

Use sqlite_ext.AutoIncrementField #143

Merged
merged 3 commits into from Mar 29, 2019

Conversation

dougthor42
Copy link
Owner

This modifies the database to force use of SQLite's AUTOINCREMENT keyword.

Note that this will create some slight overhead: https://www.sqlite.org/autoinc.html. However, I don't expect it to be a major issue given the amount of data I expect this program to handle.

This is needed because db.insert_datapoint is not returning the datapoint_id and I can't bloody figure out why. All I know is that this solves things.

+ Peewee doesn't apply UNIQUE on the column, but rather on the table.
+ SQLite highly recommends creating indexes for foreign keys.
+ The DDL post-upgrade matches what's defined by the ORM, sans migration
  tables.
@dougthor42 dougthor42 force-pushed the use-sqlite-ext-autoincrementfield branch from b773a3e to 74c4b2d Compare March 29, 2019 16:24
@dougthor42 dougthor42 merged commit 9407222 into master Mar 29, 2019
@dougthor42 dougthor42 deleted the use-sqlite-ext-autoincrementfield branch March 29, 2019 22:46
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.

None yet

1 participant