Schema refactor — introduce Tracker, rename purchases to entries #31
Labels
No labels
bug
duplicate
enhancement
good first issue
help wanted
question
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/incr#31
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refactor the database schema to introduce Tracker and remove financial-specific naming.
Target schema
Migration steps
trackerstable (user_id FK, asset_id nullable FK, label string, unit string, price_tracking_enabled bool default false)purchases→entriesentries.shares→entries.quantityentries.price_per_share→entries.unit_priceentries.tracker_idFK, dropentries.asset_id(entries linked via tracker now)milestones.tracker_idFKusers.asset_id,users.price_tracking_enabledasset_id,price_tracking_enabled,label = 'Portfolio',unit = 'shares'; backfilltracker_idon all entries and milestonesDesign decisions
positioncolumn needed yetasset_pricesunchanged — shared market price per asset symbolentries.unit_price= what user paid (broker price), distinct fromasset_prices.price(market price)