-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
After the database is migrated with no data in it, we need a way to move the data into the new one. The goal for this is to write a migration script that:
- Copies gamer_profile records adjusting columns as
- Generate UUIDs for the new id column
- Compute membership_expiry_date for each record based on membership_tier (using echo-base's tier logic: next May 1st Pacific time)
- Map all existing columns (student_number, first_name, last_name, membership_tier, banned, notes, created_at)
- Copies gamer_activity records from testdb.live.gamer_activity to echobase.public.gamer_activity
- Generate UUIDs for the new id column
- Map all columns (student_number, pc_number, game, started_at, ended_at, exec_name)
Key considerations:
- The live schema uses student_number as the PK for gamer_profile; echo-base adds a UUID id as PK while keeping student_number as a unique constraint. This is compatible.
- The live schema has no membership_expiry_date column; echo-base does. You need to compute this during migration.
- Verify foreign key integrity: every student_number in gamer_activity must exist in gamer_profile.
Validate the data after you are done.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels