SiaFoundation / renterd

A renter for Sia
https://sia.tech/software/renterd
MIT License
68 stars 20 forks source link

Add `usability` column to `contracts` table #1660

Closed peterjan closed 8 hours ago

peterjan commented 1 week ago

This PR adds a usability column to the contracts table. This is the first in a series of PRs that removes the notion of a contract set and replaces it with an indication the contract is good for renewal and thus can be used for uploading and downloading. It's an enum to ensure we can extend it without requiring a migration.

This PR essentially introduces an unused field called usability. Removing contract_sets is slightly more involved than I thought it would be. Mostly because of slabs, buffered slabs and the whole health mechanism. I plan on removing it in 3-4 PRs.

peterjan commented 5 days ago

Looking good but need to make sure the migration is tested. Especially the sqlite migration to make sure we are not dropping anything unexpectedly ^^

tested migrations on SQLite and MySQL, scratch databases though but with an entry in the contracts table, seems OK