Skip to content
Snippets Groups Projects
Commit 1299d939 authored by michael.minelli's avatar michael.minelli
Browse files

DB => Add creation date info for assignments and exercises

parent a48d6276
Branches
No related tags found
No related merge requests found
Pipeline #38011 failed
/*
Warnings:
- Added the required column `gitlabCreationDate` to the `Assignment` table without a default value. This is not possible if the table is not empty.
- Added the required column `gitlabCreationDate` to the `Exercise` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Assignment` ADD COLUMN `gitlabCreationDate` DATETIME(3) NULL AFTER `gitlabCreationInfo`;
UPDATE `Assignment` SET `gitlabCreationDate` = `gitlabLastInfoDate`;
ALTER TABLE `Assignment` MODIFY COLUMN `gitlabCreationDate` DATETIME(3) NOT NULL AFTER `gitlabCreationInfo`;
-- AlterTable
ALTER TABLE `Exercise` ADD COLUMN `gitlabCreationDate` DATETIME(3) NULL DEFAULT NULL AFTER `gitlabCreationInfo`;
UPDATE `Exercise` SET `gitlabCreationDate` = `gitlabLastInfoDate`;
ALTER TABLE `Exercise` MODIFY COLUMN `gitlabCreationDate` DATETIME(3) NOT NULL AFTER `gitlabCreationInfo`;
...@@ -38,6 +38,7 @@ model Assignment { ...@@ -38,6 +38,7 @@ model Assignment {
gitlabId Int gitlabId Int
gitlabLink String gitlabLink String
gitlabCreationInfo Json @db.Json gitlabCreationInfo Json @db.Json
gitlabCreationDate DateTime
gitlabLastInfo Json @db.Json gitlabLastInfo Json @db.Json
gitlabLastInfoDate DateTime gitlabLastInfoDate DateTime
published Boolean @default(false) published Boolean @default(false)
...@@ -55,6 +56,7 @@ model Exercise { ...@@ -55,6 +56,7 @@ model Exercise {
gitlabId Int gitlabId Int
gitlabLink String gitlabLink String
gitlabCreationInfo Json @db.Json gitlabCreationInfo Json @db.Json
gitlabCreationDate DateTime
gitlabLastInfo Json @db.Json gitlabLastInfo Json @db.Json
gitlabLastInfoDate DateTime gitlabLastInfoDate DateTime
deleted Boolean @default(false) deleted Boolean @default(false)
......
This diff is collapsed.
...@@ -175,6 +175,7 @@ class AssignmentRoutes implements RoutesManager { ...@@ -175,6 +175,7 @@ class AssignmentRoutes implements RoutesManager {
gitlabId : repository.id, gitlabId : repository.id,
gitlabLink : repository.web_url, gitlabLink : repository.web_url,
gitlabCreationInfo: repository as unknown as Prisma.JsonObject, gitlabCreationInfo: repository as unknown as Prisma.JsonObject,
gitlabCreationDate: new Date(),
gitlabLastInfo : repository as unknown as Prisma.JsonObject, gitlabLastInfo : repository as unknown as Prisma.JsonObject,
gitlabLastInfoDate: new Date(), gitlabLastInfoDate: new Date(),
staff : { staff : {
......
...@@ -234,6 +234,7 @@ class ExerciseRoutes implements RoutesManager { ...@@ -234,6 +234,7 @@ class ExerciseRoutes implements RoutesManager {
gitlabId : repository.id, gitlabId : repository.id,
gitlabLink : repository.web_url, gitlabLink : repository.web_url,
gitlabCreationInfo: repository as unknown as Prisma.JsonObject, gitlabCreationInfo: repository as unknown as Prisma.JsonObject,
gitlabCreationDate: new Date(),
gitlabLastInfo : repository as unknown as Prisma.JsonObject, gitlabLastInfo : repository as unknown as Prisma.JsonObject,
gitlabLastInfoDate: new Date(), gitlabLastInfoDate: new Date(),
members : { members : {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment