-
Notifications
You must be signed in to change notification settings - Fork 413
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
Investigate deduplication in compiled_contracts
table
#1420
Comments
I was interested and had a quick look why this happens. It seems like the NULL is treated as a different value each time. See this: https://stackoverflow.com/questions/8289100/create-unique-constraint-with-null-columns We should be able to easily fix it when recreating the database. We just need:
|
Nice! So we need to add this in either the sourcify migration or a new migration (Right now we are not using migrations properly)
|
First #1416 then this. |
As explained in #1416 the deplucation of the rows seem to be not working in the
compiled_contracts
table. Copying the explanation here:Deduplication not working in
compiled_contracts
When debugging the tests I've noticed the identical test contracts are getting added to the
compiled_contracts
table multiple times. I'd have expected them to be deduplicated because the table has a unique key property in the schema definition:sourcify/services/database/migrations/20231109160022-create-alliance-schema.js
Line 204 in 653952d
However during testing the contracts get added multiple times:
Am I missing something or is there something wrong?
To reproduce
add a breakpoint at
sourcify/services/server/test/integration/repository-handlers/files.spec.ts
Line 56 in 653952d
Add an
.only
modifier to describe:sourcify/services/server/test/integration/repository-handlers/files.spec.ts
Line 43 in 653952d
run the
Mocha - Server Integration
, deploy and verify multiple contracts, and connect to the test database atlocalhost:5431
.The text was updated successfully, but these errors were encountered: