sxflynn / TeacherGPT

A proposed GPT chatbot for teachers that uses retrieval-augmentation to answer questions about their students.
MIT License
8 stars 1 forks source link

Migrate from Long ids to UUIDs for student IDs #4

Open sxflynn opened 6 months ago

sxflynn commented 6 months ago

This is the current SQL table schema for students

CREATE TABLE "student" (
  "student_id" INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
  "first_name" varchar(255) NOT NULL,
  "middle_name" varchar(255),
  "last_name" varchar(255) NOT NULL,
  "sex" char,
  "dob" date,
  "email" varchar UNIQUE,
  "ohio_ssid" varchar UNIQUE NOT NULL,
  CONSTRAINT "chk_ohio_ssid_format" CHECK ("ohio_ssid" ~ '^[A-Za-z]{2}[0-9]{7}$')
);

and the JPA entity

@Entity
@Table(name = "student")
public class Student {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "student_id")
    private Long studentId;

A PR should be submitted to migrate from regular int ids to UUIDs. This would involve making adjustments across the entire data lifecycle, from the SQL schema, to the JPA entities and related repositories/services/resolvers, to the GraphQL schema.