verifier-alliance / database-specs

11 stars 1 forks source link

Introduce `created_by` and `updated_by` columns. Add triggers #2

Closed rimrakhimov closed 7 months ago

rimrakhimov commented 7 months ago

Database schema suggestions:

  1. Add ownership related columns (created_by, updated_by). Would help to identify buggy implementations in case if invalid sources are found. Besides, would help to setup rules according to which only the user inserted an instance should be able to modify or update it.

    Currently added to all but code and contracts tables (contract_deployments, compiled_contracts, and verified_contracts). It just seems that there is not lot of things to make mistake at with code or contracts tables. But may add the ownership columns for them as well, would be glad to discuss.

  2. Add automatic setup of 'created_by', 'updated_by', 'created_at', and 'updated_at' columns via triggers. That sets up and enforces rules of how those values should be set and modified.