-
Notifications
You must be signed in to change notification settings - Fork 362
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
Tried calling: writeInto(Instance of 'GenerationContext'), while updating table. This happened when i tried using " Future updateBalance(BalanceCompanion data) => update(balance).replace(data);" #587
Comments
Thanks for the report, can you show me the definition of the |
Thank you for replying. class Balance extends Table{ } And what i am trying to do is create/update the values for the balance table on the basis of income and expense. So, if user enters income, it gets added to balance table and if he enters Expense , it will get deducted form the balance. //Code for update
|
Your |
@kuhnroyal i was not using nullable for primary entity, until i upgraded moor to 3.0.0. After the upgrade, it started throwing errors like id cannot be null, even when using Companions to insert data. So, this was a temporary solution for me. It works fine without a problem, even it's a bad practice! :) |
Ok. Can you post your |
@kuhnroyal |
I believe you are running into a problem when the |
Not running on release, just on debug I just removed all the nullable notation, and i got following while registering the user: Table for Users Insert query for users Method for inserting user Why is it asking for id, is it because i set phone as PK? Should i set it as unique key? |
Did you regenerate? |
And I believe you can not have an |
@kuhnroyal Thank you, it solved the problem for users table! And Yes I always run this when regenerating: I removed all the nullable annotation, but still get the error while updating balance. |
I solved the problem by removing id and setting userId as primary key on balance table as well. Note: The error persisted even when i did not put id and userId both as primary key as i did on users table. Don't know what caused the problem, but removing id and puting userId as primary worked. |
The text was updated successfully, but these errors were encountered: