-
Notifications
You must be signed in to change notification settings - Fork 88
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 Bulk Imports #199
Fix Bulk Imports #199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Blacksmoke16 can you add tests that verify the timestamps
are set? We should verify that created_at
and updated_at
are properly set when imported.
Oo good call, yea can do. |
@drujensen That ought to be good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm that on_duplicate_key_update
does not change the created_at
? If so, this is approved.
I'll look into it. Will add a spec for this as well. |
@drujensen How would i see what sqlite version the tests use? |
good question. In the https://github.com/amberframework/granite/blob/master/Dockerfile#L3 You can run |
Am a total noob when it comes to sqlite, best i could do was add Anyway, reason i ask is https://www.sqlite.org/draft/releaselog/3_24_0.html. Once that gets released, if we use it, will allow sqlite to support updates like PG does. This'll prob allow the timestamps to get updated in sqlite, so could add sqlite to timestamps spec. Regardless, we can worry about that later when it actually is released. This PR should be good to go. Got a spec added that checks |
ok, this needs a second reviewer and then we can merge. |
I'll update this with new spec stuff, sec. EDIT: Some things broke, i'll look into it. |
@Blacksmoke16 I resolved some of the conflicts in the |
Rgr, seems some of the specs fail now, ill see what's wrong. |
There is a bug with the migrator that doesn't apply I logged out the table_name k/value of the PK by doing
Notice how all the models with |
@Blacksmoke16 ahhh, yup. Let me push a fix for that. thanks! |
Here #203 is a fix for the PRIMARY KEY auto:false |
@Blacksmoke16 go ahead and rebase. Let's get this merged. |
This PR addresses some issues i uncovered recently, removing too much when implementing the batch size, while the tests passed.
ignore_on_duplicate
andupdate_on_duplicate
Granite::ORM::Collection(self)
typing tomodel_array
param so that records can be fetched from DB, iterated upon, and reimported easily. See This Specbatch_size
,ignore_on_duplicate
andupdate_on_duplicate
for each of the following: