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
No related branches found
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 {
gitlabId Int
gitlabLink String
gitlabCreationInfo Json @db.Json
gitlabCreationDate DateTime
gitlabLastInfo Json @db.Json
gitlabLastInfoDate DateTime
published Boolean @default(false)
......@@ -55,6 +56,7 @@ model Exercise {
gitlabId Int
gitlabLink String
gitlabCreationInfo Json @db.Json
gitlabCreationDate DateTime
gitlabLastInfo Json @db.Json
gitlabLastInfoDate DateTime
deleted Boolean @default(false)
......
This diff is collapsed.
......@@ -175,6 +175,7 @@ class AssignmentRoutes implements RoutesManager {
gitlabId : repository.id,
gitlabLink : repository.web_url,
gitlabCreationInfo: repository as unknown as Prisma.JsonObject,
gitlabCreationDate: new Date(),
gitlabLastInfo : repository as unknown as Prisma.JsonObject,
gitlabLastInfoDate: new Date(),
staff : {
......
......@@ -234,6 +234,7 @@ class ExerciseRoutes implements RoutesManager {
gitlabId : repository.id,
gitlabLink : repository.web_url,
gitlabCreationInfo: repository as unknown as Prisma.JsonObject,
gitlabCreationDate: new Date(),
gitlabLastInfo : repository as unknown as Prisma.JsonObject,
gitlabLastInfoDate: new Date(),
members : {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment