-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat: Add migration for keyset_id as foreign key in SQLite database #634
Conversation
59ed409
to
556c384
Compare
cc @ok300 |
556c384
to
b569a46
Compare
crates/cdk-sqlite/src/mint/migrations/20250306165813_keyset_id_as_foreign_key.sql
Outdated
Show resolved
Hide resolved
tracing::debug!("Attempting to add known proof. Skipping.... {:?}", err); | ||
.await; | ||
|
||
if let Err(err) = result { |
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.
The error matching is becoming quite complex. Instead it, why not change the query to INSERT ON CONFLICT IGNORE
or INSERT OR IGNORE
? I think that would automatically cover both relevant error types:
- proof is already known (conflict on proof's PK
y
) - conflict on FK constraint
We wouldn't know why a proof wasn't inserted, but if that's important, we could 1-2 validation steps before the query (check if proof's PK y
is known, check if foreign key is valid).
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.
Address in c6f3318
I think we still want to error and rollback when there is a fk error
…drop improvements
c6f3318
to
a74e49a
Compare
Description
closes #628
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-check
before committing