From 17902b8c3703f634e8319e3688f128b0760afd7a Mon Sep 17 00:00:00 2001 From: Joel von der Weid <joel.von-der-weid@hesge.ch> Date: Mon, 11 Mar 2024 15:54:45 +0100 Subject: [PATCH] Add language to assignment in db --- .../migration.sql | 2 + ExpressAPI/prisma/schema.prisma | 69 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 ExpressAPI/prisma/migrations/20240311145203_add_language_to_assignment/migration.sql diff --git a/ExpressAPI/prisma/migrations/20240311145203_add_language_to_assignment/migration.sql b/ExpressAPI/prisma/migrations/20240311145203_add_language_to_assignment/migration.sql new file mode 100644 index 0000000..94b1ce8 --- /dev/null +++ b/ExpressAPI/prisma/migrations/20240311145203_add_language_to_assignment/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `Assignment` ADD COLUMN `language` ENUM('abap', 'ada', 'asm', 'bash', 'bqn', 'c', 'caml', 'cloudformation', 'csharp', 'css', 'cuda', 'dart', 'delphi', 'docker', 'erlang', 'f', 'fsharp', 'flex', 'fortran', 'futhark', 'go', 'groovy', 'haskell', 'hepial', 'json', 'jsp', 'java', 'js', 'julia', 'kotlin', 'kubernetes', 'latex', 'lisp', 'lua', 'matlab', 'objc', 'ocaml', 'pascal', 'pearl', 'perl', 'php', 'postscript', 'powershell', 'prolog', 'promela', 'python', 'r', 'ruby', 'rust', 'scala', 'sql', 'smalltalk', 'swift', 'terraform', 'text', 'ts', 'tsql', 'typst', 'vba', 'vbnet', 'web', 'xml', 'yaml', 'other') NOT NULL DEFAULT 'other'; diff --git a/ExpressAPI/prisma/schema.prisma b/ExpressAPI/prisma/schema.prisma index df7bad2..677ea6a 100644 --- a/ExpressAPI/prisma/schema.prisma +++ b/ExpressAPI/prisma/schema.prisma @@ -35,6 +35,7 @@ model Assignment { gitlabLastInfoDate DateTime published Boolean @default(false) useSonar Boolean @default(false) + language Language @default(other) exercises Exercise[] staff User[] @@ -72,3 +73,71 @@ model Result { @@id([exerciseId, dateTime]) } + +enum Language { + abap + ada + asm + bash + bqn + c + caml + cloudformation + csharp + css + cuda + dart + delphi + docker + erlang + f + fsharp + flex + fortran + futhark + go + groovy + haskell + hepial + json + jsp + java + js + julia + kotlin + kubernetes + latex + lisp + lua + matlab + objc + ocaml + pascal + pearl + perl + php + postscript + powershell + prolog + promela + python + r + ruby + rust + scala + sql + smalltalk + swift + terraform + text + ts + tsql + typst + vba + vbnet + web + xml + yaml + + other +} -- GitLab