ID: F202512191206
Tags: ERD, Avans 2-1 LU3
File Link: avans 2-1 lu3 erd.svg, avans 2-1 lu3 erd v2.svg, Avans 2-1 lu3 ERD v3.svg, Avans 2-1 lu3 ERD v4.svg, Avans 2-1 lu3 ERD v5.svg
Status: File-Descriptor

FILE - avans 2-1 lu3 ERD

our dbdiagram code for v5:

// v5
 
Table users {
  id uuid [pk, not null]
  email varchar(255) [not null, unique]
  password_hash varchar(255) [not null]
  token_version int (11) [not null]
 
  created_at datetime [not null]
  updated_at datetime [not null]
}
 
Table refresh_tokens {
  id uuid [pk, not null]
  user_id varchar(36) [not null, unique]
  token_hash varchar(255) [not null]
  expires_at datetime [not null]
 
  revoked_at datetime [null]
  created_at datetime [not null]
}
 
Table roles {
  id int(11) [pk, increment, not null]
  name varchar(255) [not null, unique]
}
 
Table user_roles {
  user_id uuid [not null]
  role_id int(11) [not null]
 
  indexes {
    (user_id, role_id) [pk]
  }
}
 
Table student_favourites {
  student_id uuid [not null]
  module_id int(11) [not null]
 
  indexes {
    (student_id, module_id) [pk]
  }
}
 
Table student_profiles {
  id uuid [pk, not null]
  user_id uuid [not null, unique]
 
  interests text
  merits text
  goals text
 
  created_at datetime [not null]
  updated_at datetime [not null]
}
 
Table module_information {
  id int(11) [pk, not null]
  name varchar(255) [not null]
  shortdescription varchar(255) [not null]
  description text [not null]
  studycredit int(11) [not null]
  location varchar(255) [not null]
  contact_id int(11) [not null]
  level varchar(255) [not null]
  module_tags longtext [not null]
  popularity_score int(11) [not null]
  estimated_difficuty int(11) [not null]
  available_spots int(11) [not null]
  start_date date [not null]
 
  created_at datetime [not null]
  updated_at datetime [not null]
}
 
Table recommendation_cache {
  id uuid [pk]
  user_id uuid [not null]
 
  interests text [not null]
  merits text [not null]
  goals text [not null]
 
  model_version varchar(255) [not null]
 
  created_at datetime [not null]
  expires_at timestamp
}
 
Table recommendation_order {
  recommendation_cache_id uuid [not null]
  module_information_id int(11) [not null]
  recommendation_order int(11) [not null]
  matchin_keywords text
}
 
Ref: recommendation_cache.id < recommendation_order.recommendation_cache_id
Ref: module_information.id < recommendation_order.module_information_id
 
Ref: refresh_tokens.user_id > users.id
 
Ref: user_roles.user_id > users.id
Ref: user_roles.role_id > roles.id
Ref: users.id - student_profiles.user_id
Ref: recommendation_cache.user_id > users.id
 
Ref: student_favourites.student_id > users.id
Ref: student_favourites.module_id > module_information.id

References