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

Replace compiled_contracts.sources column with source_codes and compiled_contracts_sources tables #15

Merged
merged 7 commits into from
Sep 9, 2024

Conversation

marcocastignoli
Copy link
Contributor

This PR adds the two new tables that will replace the compiled_contracts.sources column: source_codes and compiled_contracts_sources.

In source_codes we provide the source hashes (sha256,keccak256), the language (solidity,vyper,...) the content of the file and the standard timestamp and ownership fields; we use the file's sha256 as primary key. language is stored here to avoid having to join compiled_contract to find the language of that source.

compiled_contracts_sources is a many-to-many relationship table between compiled_contract and source_codes using their respective PK as foreign keys (compilation_id->compiled_contract.id, source_code_hash->source_codes.source_codes). In compiled_contracts_sources we also have the path, since it varies for every compilation. This table doesn't contain timestamp and ownership fields since it's an extension of the compiled_contract table.

Diagram

image

database.sql Show resolved Hide resolved
database.sql Outdated Show resolved Hide resolved
database.sql Outdated Show resolved Hide resolved
database.sql Outdated Show resolved Hide resolved
database.sql Outdated Show resolved Hide resolved
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.

2 participants