aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirserver/src/schema_v1.sql
Commit message (Collapse)AuthorAgeFilesLines
* tor-dirserver: Make fingerprint optional in router_descriptorClara Engler2026-04-281-2/+2
| | | | | | | | This commit changes the schema to make the fingerprint optional. Reason for this is, that microdescriptors are also stored in this table and microdescriptors only contain an OPTIONAL onion-key, meaning it may not always be possible to determine this value from a microdescriptor, thereby making it silly to require it here.
* tor-dirserver: Store precisely one descriptor hash in schemaClara Engler2026-04-271-12/+10
| | | | | | | | | | | | | | | | | | This commit modifies the consensus_router_descriptor_member table in the database schema, removing the NOT NULL constraint on unsigned_sha1 and unsigned_sha2 by replacing it with a new CHECK constraint that checks that either one of them is set but not both. The reason for this is as follows: We are going to use this table to compute the queue of missing descriptors, which means that we can only populate this table with the data we know from the consensus. The consensus however tells us only one of those hashes, namely sha1 in the case of a consensus-ns and sha2 in the case of a consensus-md. In other words: This commit can also be seen as an effort to change the design of the operation in such a way that the queue is obtained directly from the database and not computed at the start during state transition.
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* tor-dirserver: SQL comment for unsigned hashesClara Engler2026-03-091-0/+11
| | | | | This commit documents why and how we use the `unsigned_` fields in the `consensus_router_descriptor_member` table alongside SQL limitations.
* tor-dirserver: Remove fiddly SQL CHECKClara Engler2026-03-091-5/+1
|
* tor-dirserver: Move schema to own fileClara Engler2026-03-091-0/+166
This commit moves the database schema into schema_v1.sql and uses include_str to include it. For now, the schema lives in the `src/` directory. If this becomes a problem because we get more schemas and schema upgrades, we can move it into another sub directory, but let's not overengineer the hierarchy there.