Skip to content
Snippets Groups Projects
Commit cd0eb9a2 authored by benjamin.anthonio's avatar benjamin.anthonio
Browse files
parents 6fd70b61 3158820a
Branches
No related tags found
No related merge requests found
Showing
with 20 additions and 444 deletions
# Étape 1 : Construction de l'application
FROM node:18 AS builder
# Définir le répertoire de travail
WORKDIR /app
# Copier tout le projet depuis ta machine (y compris tsconfig.json)
COPY . .
# Copier les fichiers package
COPY package.json package-lock.json ./
# Installer les dépendances
RUN npm install
# Compiler TypeScript
# Copier les fichiers sources
COPY . .
# Compiler le projet TypeScript
RUN npm run build
# Étape 2 : Image de production
FROM node:18
# Définir le répertoire de travail
WORKDIR /app
# Copier les fichiers de production depuis le builder
COPY --from=builder /app .
# Copier les fichiers nécessaires depuis le builder
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/prisma ./prisma
COPY package.json ./
COPY .env .env
COPY entrypoint.sh ./entrypoint.sh
# Donner les permissions nécessaires
RUN chmod +x entrypoint.sh
EXPOSE 30992
CMD ["npm", "run", "start:dev"]
\ No newline at end of file
# Utilisation du script d'entrée
ENTRYPOINT ["sh", "./entrypoint.sh"]
File deleted
-- This is an empty migration.
\ No newline at end of file
-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"mail" TEXT,
"gitlabUsername" TEXT NOT NULL,
"deleted" BOOLEAN NOT NULL DEFAULT false
);
-- CreateIndex
CREATE UNIQUE INDEX "User_mail_key" ON "User"("mail");
-- CreateIndex
CREATE UNIQUE INDEX "User_gitlabUsername_key" ON "User"("gitlabUsername");
-- CreateTable
CREATE TABLE "QCM" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" TEXT NOT NULL,
"randomOrder" BOOLEAN NOT NULL
);
-- CreateTable
CREATE TABLE "Type" (
"idType" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomType" TEXT NOT NULL
);
-- CreateTable
CREATE TABLE "Choix" (
"idChoix" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"isCorrect" BOOLEAN NOT NULL,
"idQuestion" INTEGER NOT NULL,
CONSTRAINT "Choix_idQuestion_fkey" FOREIGN KEY ("idQuestion") REFERENCES "Question" ("idQuestion") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Question" (
"idQuestion" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"question" TEXT NOT NULL,
"position" INTEGER NOT NULL,
"nbPtsPositif" INTEGER NOT NULL,
"nbPtsNegatif" INTEGER NOT NULL,
"numeric" BOOLEAN,
"idQCM" INTEGER NOT NULL,
"idType" INTEGER NOT NULL,
CONSTRAINT "Question_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QCM" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Question_idType_fkey" FOREIGN KEY ("idType") REFERENCES "Type" ("idType") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- CreateTable
CREATE TABLE "Reponse" (
"idQuestion" INTEGER NOT NULL,
"idChoix" INTEGER NOT NULL,
"idUser" INTEGER NOT NULL,
"numeric" REAL,
PRIMARY KEY ("idQuestion", "idChoix", "idUser"),
CONSTRAINT "Reponse_idQuestion_fkey" FOREIGN KEY ("idQuestion") REFERENCES "Question" ("idQuestion") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Reponse_idChoix_fkey" FOREIGN KEY ("idChoix") REFERENCES "Choix" ("idChoix") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Reponse_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
/*
Warnings:
- Added the required column `codeAcces` to the `QCM` table without a default value. This is not possible if the table is not empty.
*/
-- CreateTable
CREATE TABLE "Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QCM" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_QCM" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" TEXT NOT NULL,
"randomOrder" BOOLEAN NOT NULL,
"codeAcces" INTEGER NOT NULL
);
INSERT INTO "new_QCM" ("idQCM", "nomQCM", "randomOrder", "temps") SELECT "idQCM", "nomQCM", "randomOrder", "temps" FROM "QCM";
DROP TABLE "QCM";
ALTER TABLE "new_QCM" RENAME TO "QCM";
PRAGMA foreign_key_check("QCM");
PRAGMA foreign_keys=ON;
/*
Warnings:
- Added the required column `feedback` to the `Participer` table without a default value. This is not possible if the table is not empty.
- Added the required column `note` to the `Participer` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QCM" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("idQCM", "idUser") SELECT "idQCM", "idUser" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_keys=ON;
/*
Warnings:
- Added the required column `nomChoix` to the `Choix` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Choix" (
"idChoix" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"isCorrect" BOOLEAN NOT NULL,
"idQuestion" INTEGER NOT NULL,
"nomChoix" TEXT NOT NULL,
CONSTRAINT "Choix_idQuestion_fkey" FOREIGN KEY ("idQuestion") REFERENCES "Question" ("idQuestion") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Choix" ("idChoix", "idQuestion", "isCorrect") SELECT "idChoix", "idQuestion", "isCorrect" FROM "Choix";
DROP TABLE "Choix";
ALTER TABLE "new_Choix" RENAME TO "Choix";
PRAGMA foreign_key_check("Choix");
PRAGMA foreign_keys=ON;
/*
Warnings:
- You are about to drop the `QCM` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "QCM";
PRAGMA foreign_keys=on;
-- CreateTable
CREATE TABLE "Qcm" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" TEXT NOT NULL,
"randomOrder" BOOLEAN NOT NULL,
"codeAcces" INTEGER NOT NULL
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Question" (
"idQuestion" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"question" TEXT NOT NULL,
"position" INTEGER NOT NULL,
"nbPtsPositif" INTEGER NOT NULL,
"nbPtsNegatif" INTEGER NOT NULL,
"numeric" BOOLEAN,
"idQCM" INTEGER NOT NULL,
"idType" INTEGER NOT NULL,
CONSTRAINT "Question_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "Qcm" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Question_idType_fkey" FOREIGN KEY ("idType") REFERENCES "Type" ("idType") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Question" ("idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question") SELECT "idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question" FROM "Question";
DROP TABLE "Question";
ALTER TABLE "new_Question" RENAME TO "Question";
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "Qcm" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("feedback", "idQCM", "idUser", "note") SELECT "feedback", "idQCM", "idUser", "note" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
PRAGMA foreign_key_check("Question");
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_keys=ON;
/*
Warnings:
- You are about to drop the `Qcm` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
PRAGMA foreign_keys=off;
DROP TABLE "Qcm";
PRAGMA foreign_keys=on;
-- CreateTable
CREATE TABLE "QcmTable" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" TEXT NOT NULL,
"randomOrder" BOOLEAN NOT NULL,
"codeAcces" INTEGER NOT NULL
);
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Question" (
"idQuestion" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"question" TEXT NOT NULL,
"position" INTEGER NOT NULL,
"nbPtsPositif" INTEGER NOT NULL,
"nbPtsNegatif" INTEGER NOT NULL,
"numeric" BOOLEAN,
"idQCM" INTEGER NOT NULL,
"idType" INTEGER NOT NULL,
CONSTRAINT "Question_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Question_idType_fkey" FOREIGN KEY ("idType") REFERENCES "Type" ("idType") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Question" ("idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question") SELECT "idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question" FROM "Question";
DROP TABLE "Question";
ALTER TABLE "new_Question" RENAME TO "Question";
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("feedback", "idQCM", "idUser", "note") SELECT "feedback", "idQCM", "idUser", "note" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
PRAGMA foreign_key_check("Question");
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_keys=ON;
/*
Warnings:
- Added the required column `heureDebut` to the `Participer` table without a default value. This is not possible if the table is not empty.
- Added the required column `position` to the `Choix` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
"heureDebut" TEXT NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("feedback", "idQCM", "idUser", "note") SELECT "feedback", "idQCM", "idUser", "note" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
CREATE TABLE "new_Choix" (
"idChoix" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"isCorrect" BOOLEAN NOT NULL,
"idQuestion" INTEGER NOT NULL,
"nomChoix" TEXT NOT NULL,
"position" INTEGER NOT NULL,
CONSTRAINT "Choix_idQuestion_fkey" FOREIGN KEY ("idQuestion") REFERENCES "Question" ("idQuestion") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Choix" ("idChoix", "idQuestion", "isCorrect", "nomChoix") SELECT "idChoix", "idQuestion", "isCorrect", "nomChoix" FROM "Choix";
DROP TABLE "Choix";
ALTER TABLE "new_Choix" RENAME TO "Choix";
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_key_check("Choix");
PRAGMA foreign_keys=ON;
/*
Warnings:
- Added the required column `isMultiple` to the `Question` table without a default value. This is not possible if the table is not empty.
- Added the required column `idUserCreator` to the `QcmTable` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Question" (
"idQuestion" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"question" TEXT NOT NULL,
"position" INTEGER NOT NULL,
"nbPtsPositif" INTEGER NOT NULL,
"nbPtsNegatif" INTEGER NOT NULL,
"numeric" BOOLEAN,
"idQCM" INTEGER NOT NULL,
"idType" INTEGER NOT NULL,
"isMultiple" BOOLEAN NOT NULL,
CONSTRAINT "Question_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Question_idType_fkey" FOREIGN KEY ("idType") REFERENCES "Type" ("idType") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Question" ("idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question") SELECT "idQCM", "idQuestion", "idType", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question" FROM "Question";
DROP TABLE "Question";
ALTER TABLE "new_Question" RENAME TO "Question";
CREATE TABLE "new_QcmTable" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" TEXT NOT NULL,
"randomOrder" BOOLEAN NOT NULL,
"codeAcces" INTEGER NOT NULL,
"idUserCreator" INTEGER NOT NULL,
CONSTRAINT "QcmTable_idUserCreator_fkey" FOREIGN KEY ("idUserCreator") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_QcmTable" ("codeAcces", "idQCM", "nomQCM", "randomOrder", "temps") SELECT "codeAcces", "idQCM", "nomQCM", "randomOrder", "temps" FROM "QcmTable";
DROP TABLE "QcmTable";
ALTER TABLE "new_QcmTable" RENAME TO "QcmTable";
PRAGMA foreign_key_check("Question");
PRAGMA foreign_key_check("QcmTable");
PRAGMA foreign_keys=ON;
-- This is an empty migration.
\ No newline at end of file
/*
Warnings:
- You are about to alter the column `heureDebut` on the `Participer` table. The data in that column could be lost. The data in that column will be cast from `String` to `Int`.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
"heureDebut" INTEGER NOT NULL,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("feedback", "heureDebut", "idQCM", "idUser", "note") SELECT "feedback", "heureDebut", "idQCM", "idUser", "note" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_keys=ON;
/*
Warnings:
- You are about to alter the column `temps` on the `QcmTable` table. The data in that column could be lost. The data in that column will be cast from `String` to `Int`.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_QcmTable" (
"idQCM" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"nomQCM" TEXT NOT NULL,
"temps" INTEGER NOT NULL,
"randomOrder" BOOLEAN NOT NULL,
"codeAcces" INTEGER NOT NULL,
"idUserCreator" INTEGER NOT NULL,
CONSTRAINT "QcmTable_idUserCreator_fkey" FOREIGN KEY ("idUserCreator") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_QcmTable" ("codeAcces", "idQCM", "idUserCreator", "nomQCM", "randomOrder", "temps") SELECT "codeAcces", "idQCM", "idUserCreator", "nomQCM", "randomOrder", "temps" FROM "QcmTable";
DROP TABLE "QcmTable";
ALTER TABLE "new_QcmTable" RENAME TO "QcmTable";
PRAGMA foreign_key_check("QcmTable");
PRAGMA foreign_keys=ON;
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Participer" (
"idUser" INTEGER NOT NULL,
"idQCM" INTEGER NOT NULL,
"feedback" TEXT NOT NULL,
"note" REAL NOT NULL,
"heureDebut" INTEGER NOT NULL,
"hasFinished" BOOLEAN NOT NULL DEFAULT false,
PRIMARY KEY ("idUser", "idQCM"),
CONSTRAINT "Participer_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Participer_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Participer" ("feedback", "heureDebut", "idQCM", "idUser", "note") SELECT "feedback", "heureDebut", "idQCM", "idUser", "note" FROM "Participer";
DROP TABLE "Participer";
ALTER TABLE "new_Participer" RENAME TO "Participer";
PRAGMA foreign_key_check("Participer");
PRAGMA foreign_keys=ON;
/*
Warnings:
- You are about to alter the column `numeric` on the `Question` table. The data in that column could be lost. The data in that column will be cast from `Boolean` to `Int`.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Question" (
"idQuestion" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"question" TEXT NOT NULL,
"position" INTEGER NOT NULL,
"nbPtsPositif" INTEGER NOT NULL,
"nbPtsNegatif" INTEGER NOT NULL,
"numeric" INTEGER,
"idQCM" INTEGER NOT NULL,
"idType" INTEGER NOT NULL,
"isMultiple" BOOLEAN NOT NULL,
CONSTRAINT "Question_idQCM_fkey" FOREIGN KEY ("idQCM") REFERENCES "QcmTable" ("idQCM") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Question_idType_fkey" FOREIGN KEY ("idType") REFERENCES "Type" ("idType") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Question" ("idQCM", "idQuestion", "idType", "isMultiple", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question") SELECT "idQCM", "idQuestion", "idType", "isMultiple", "nbPtsNegatif", "nbPtsPositif", "numeric", "position", "question" FROM "Question";
DROP TABLE "Question";
ALTER TABLE "new_Question" RENAME TO "Question";
PRAGMA foreign_key_check("Question");
PRAGMA foreign_keys=ON;
-- This is an empty migration.
\ No newline at end of file
/*
Warnings:
- The primary key for the `Reponse` table will be changed. If it partially fails, the table could be left without primary key constraint.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Reponse" (
"idQuestion" INTEGER NOT NULL,
"idChoix" INTEGER,
"idUser" INTEGER NOT NULL,
"numeric" REAL,
PRIMARY KEY ("idQuestion", "idUser"),
CONSTRAINT "Reponse_idQuestion_fkey" FOREIGN KEY ("idQuestion") REFERENCES "Question" ("idQuestion") ON DELETE RESTRICT ON UPDATE CASCADE,
CONSTRAINT "Reponse_idChoix_fkey" FOREIGN KEY ("idChoix") REFERENCES "Choix" ("idChoix") ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT "Reponse_idUser_fkey" FOREIGN KEY ("idUser") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Reponse" ("idChoix", "idQuestion", "idUser", "numeric") SELECT "idChoix", "idQuestion", "idUser", "numeric" FROM "Reponse";
DROP TABLE "Reponse";
ALTER TABLE "new_Reponse" RENAME TO "Reponse";
CREATE UNIQUE INDEX "Reponse_idQuestion_idUser_idChoix_key" ON "Reponse"("idQuestion", "idUser", "idChoix");
PRAGMA foreign_key_check("Reponse");
PRAGMA foreign_keys=ON;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment