pledge4future / WePledge

WebApp to calculate work related CO2e emissions from heating and electricity consumption as well as business trips and commuting.
https://pledge4future.org
GNU General Public License v3.0
6 stars 2 forks source link

Enhance emission entries with id fields #329

Open codingfabi opened 12 months ago

codingfabi commented 12 months ago

All of the emission entries should contain a unique identifier and the id of the user that created the entry. This would enable us to select/delete/edit specific entries.

Is a blocker for #248 and #97

codingfabi commented 11 months ago

@redfrexx I did not really make progress here because I do not understand how to reset the database schema and how to add a uuid field to the emission entries. Maybe you can show me an example for one of the entry types or smth...

redfrexx commented 11 months ago

Adding an id field should work using the models.UUID() class, e.g. https://github.com/pledge4future/WePledge/blob/dev/backend/src/emissions/models/customUser.py#L14C1-L14C1

After changing the database schema you have to delete all docker containers, images and volumes and delete all files in the migrations folder. Hope this helps, @codingfabi!