AthletiFi / athletifi-website

Official website for AthletiFi
https://www.athleti.fi
1 stars 5 forks source link

Referral feature: Database #240

Closed qisforq closed 1 month ago

qisforq commented 2 months ago

Objective:

Modify the database schema to support the Invite a Friend feature by extending existing tables and creating a new table for invitations.

Sub-tasks:

  1. Extend the player_cards_images table to include an 'owner' field, which will store the user_id of the user who owns the card.
  2. Create the invitations table with the following fields:
    • invite_id (primary key, unique identifier)
    • guest_email (text field for the email of the invited guest)
    • card (foreign key linking to the card_id in the player_cards_images table)
    • status (custom enum type with values 'pending', 'accepted', and 'revoked')
    • guest (foreign key linking to the user_id in the users table for the invited guest)
    • created_at (optional timestamp for when the invite was created)
    • accepted_at (optional timestamp for when the invite was accepted)
    • revoked_at (optional timestamp for when the invite was revoked)
  3. Optionally extend the users table to include a created_at timestamp. Image