diff --git a/.manus/db/db-query-1768216505244.json b/.manus/db/db-query-1768216505244.json new file mode 100644 index 0000000..a396fda --- /dev/null +++ b/.manus/db/db-query-1768216505244.json @@ -0,0 +1,74 @@ +{ + "query": "DESCRIBE apprenants;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute DESCRIBE apprenants;", + "rows": [ + { + "Field": "id", + "Type": "int(11)", + "Null": "NO", + "Key": "PRI", + "Default": "NULL", + "Extra": "auto_increment" + }, + { + "Field": "nom", + "Type": "varchar(255)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "prenom", + "Type": "varchar(255)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "email", + "Type": "varchar(320)", + "Null": "NO", + "Key": "UNI", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "codeEtablissement", + "Type": "varchar(50)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "createdAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "" + }, + { + "Field": "updatedAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "DEFAULT_GENERATED on update CURRENT_TIMESTAMP" + }, + { + "Field": "fonction", + "Type": "enum('directeur','chef_service','autre')", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + } + ], + "messages": [], + "stdout": "Field\tType\tNull\tKey\tDefault\tExtra\nid\tint(11)\tNO\tPRI\tNULL\tauto_increment\nnom\tvarchar(255)\tNO\t\tNULL\t\nprenom\tvarchar(255)\tNO\t\tNULL\t\nemail\tvarchar(320)\tNO\tUNI\tNULL\t\ncodeEtablissement\tvarchar(50)\tNO\t\tNULL\t\ncreatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\t\nupdatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\tDEFAULT_GENERATED on update CURRENT_TIMESTAMP\nfonction\tenum('directeur','chef_service','autre')\tNO\t\tNULL\t\n", + "stderr": "", + "execution_time_ms": 664 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216510525.json b/.manus/db/db-query-1768216510525.json new file mode 100644 index 0000000..736b482 --- /dev/null +++ b/.manus/db/db-query-1768216510525.json @@ -0,0 +1,114 @@ +{ + "query": "DESCRIBE sequences;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute DESCRIBE sequences;", + "rows": [ + { + "Field": "id", + "Type": "int(11)", + "Null": "NO", + "Key": "PRI", + "Default": "NULL", + "Extra": "auto_increment" + }, + { + "Field": "formationId", + "Type": "int(11)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "nom", + "Type": "varchar(255)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "lieu", + "Type": "varchar(500)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "capaciteMax", + "Type": "int(11)", + "Null": "NO", + "Key": "", + "Default": "12", + "Extra": "" + }, + { + "Field": "dateBlocage", + "Type": "datetime", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "statut", + "Type": "enum('ouverte','bloquee','terminee')", + "Null": "NO", + "Key": "", + "Default": "ouverte", + "Extra": "" + }, + { + "Field": "createdAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "" + }, + { + "Field": "updatedAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "DEFAULT_GENERATED on update CURRENT_TIMESTAMP" + }, + { + "Field": "publicCible", + "Type": "enum('directeur','chef_service','tous','autre')", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "formateur", + "Type": "varchar(255)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "formateurId", + "Type": "int(11)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "qrCodeToken", + "Type": "varchar(64)", + "Null": "YES", + "Key": "", + "Default": "NULL", + "Extra": "" + } + ], + "messages": [], + "stdout": "Field\tType\tNull\tKey\tDefault\tExtra\nid\tint(11)\tNO\tPRI\tNULL\tauto_increment\nformationId\tint(11)\tNO\t\tNULL\t\nnom\tvarchar(255)\tNO\t\tNULL\t\nlieu\tvarchar(500)\tNO\t\tNULL\t\ncapaciteMax\tint(11)\tNO\t\t12\t\ndateBlocage\tdatetime\tNO\t\tNULL\t\nstatut\tenum('ouverte','bloquee','terminee')\tNO\t\touverte\t\ncreatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\t\nupdatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\tDEFAULT_GENERATED on update CURRENT_TIMESTAMP\npublicCible\tenum('directeur','chef_service','tous','autre')\tNO\t\tNULL\t\nformateur\tvarchar(255)\tYES\t\tNULL\t\nformateurId\tint(11)\tYES\t\tNULL\t\nqrCodeToken\tvarchar(64)\tYES\t\tNULL\t\n", + "stderr": "", + "execution_time_ms": 54 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216533905.json b/.manus/db/db-query-1768216533905.json new file mode 100644 index 0000000..a921fe6 --- /dev/null +++ b/.manus/db/db-query-1768216533905.json @@ -0,0 +1,74 @@ +{ + "query": "SHOW COLUMNS FROM apprenants;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SHOW COLUMNS FROM apprenants;", + "rows": [ + { + "Field": "id", + "Type": "int(11)", + "Null": "NO", + "Key": "PRI", + "Default": "NULL", + "Extra": "auto_increment" + }, + { + "Field": "nom", + "Type": "varchar(255)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "prenom", + "Type": "varchar(255)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "email", + "Type": "varchar(320)", + "Null": "NO", + "Key": "UNI", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "codeEtablissement", + "Type": "varchar(50)", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + }, + { + "Field": "createdAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "" + }, + { + "Field": "updatedAt", + "Type": "timestamp", + "Null": "NO", + "Key": "", + "Default": "CURRENT_TIMESTAMP", + "Extra": "DEFAULT_GENERATED on update CURRENT_TIMESTAMP" + }, + { + "Field": "fonction", + "Type": "enum('directeur','chef_service','autre')", + "Null": "NO", + "Key": "", + "Default": "NULL", + "Extra": "" + } + ], + "messages": [], + "stdout": "Field\tType\tNull\tKey\tDefault\tExtra\nid\tint(11)\tNO\tPRI\tNULL\tauto_increment\nnom\tvarchar(255)\tNO\t\tNULL\t\nprenom\tvarchar(255)\tNO\t\tNULL\t\nemail\tvarchar(320)\tNO\tUNI\tNULL\t\ncodeEtablissement\tvarchar(50)\tNO\t\tNULL\t\ncreatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\t\nupdatedAt\ttimestamp\tNO\t\tCURRENT_TIMESTAMP\tDEFAULT_GENERATED on update CURRENT_TIMESTAMP\nfonction\tenum('directeur','chef_service','autre')\tNO\t\tNULL\t\n", + "stderr": "", + "execution_time_ms": 51 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216552298.json b/.manus/db/db-query-1768216552298.json new file mode 100644 index 0000000..a3cd667 --- /dev/null +++ b/.manus/db/db-query-1768216552298.json @@ -0,0 +1,13 @@ +{ + "query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' AND COLUMN_NAME LIKE '%etablissement%';", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' AND COLUMN_NAME LIKE '%etablissement%';", + "rows": [ + { + "COLUMN_NAME": "codeEtablissement" + } + ], + "messages": [], + "stdout": "COLUMN_NAME\ncodeEtablissement\n", + "stderr": "", + "execution_time_ms": 61 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216557806.json b/.manus/db/db-query-1768216557806.json new file mode 100644 index 0000000..85b8f69 --- /dev/null +++ b/.manus/db/db-query-1768216557806.json @@ -0,0 +1,34 @@ +{ + "query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' ORDER BY ORDINAL_POSITION;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' ORDER BY ORDINAL_POSITION;", + "rows": [ + { + "COLUMN_NAME": "id" + }, + { + "COLUMN_NAME": "nom" + }, + { + "COLUMN_NAME": "prenom" + }, + { + "COLUMN_NAME": "email" + }, + { + "COLUMN_NAME": "codeEtablissement" + }, + { + "COLUMN_NAME": "createdAt" + }, + { + "COLUMN_NAME": "updatedAt" + }, + { + "COLUMN_NAME": "fonction" + } + ], + "messages": [], + "stdout": "COLUMN_NAME\nid\nnom\nprenom\nemail\ncodeEtablissement\ncreatedAt\nupdatedAt\nfonction\n", + "stderr": "", + "execution_time_ms": 75 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216585283.json b/.manus/db/db-query-1768216585283.json new file mode 100644 index 0000000..a8fe79a --- /dev/null +++ b/.manus/db/db-query-1768216585283.json @@ -0,0 +1,82 @@ +{ + "query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sequences' ORDER BY ORDINAL_POSITION;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sequences' ORDER BY ORDINAL_POSITION;", + "rows": [ + { + "COLUMN_NAME": "TABLE_CATALOG" + }, + { + "COLUMN_NAME": "id" + }, + { + "COLUMN_NAME": "formationId" + }, + { + "COLUMN_NAME": "SEQUENCE_SCHEMA" + }, + { + "COLUMN_NAME": "nom" + }, + { + "COLUMN_NAME": "SEQUENCE_NAME" + }, + { + "COLUMN_NAME": "lieu" + }, + { + "COLUMN_NAME": "CACHE" + }, + { + "COLUMN_NAME": "capaciteMax" + }, + { + "COLUMN_NAME": "CACHE_VALUE" + }, + { + "COLUMN_NAME": "dateBlocage" + }, + { + "COLUMN_NAME": "CYCLE" + }, + { + "COLUMN_NAME": "statut" + }, + { + "COLUMN_NAME": "INCREMENT" + }, + { + "COLUMN_NAME": "createdAt" + }, + { + "COLUMN_NAME": "MAX_VALUE" + }, + { + "COLUMN_NAME": "updatedAt" + }, + { + "COLUMN_NAME": "MIN_VALUE" + }, + { + "COLUMN_NAME": "publicCible" + }, + { + "COLUMN_NAME": "START" + }, + { + "COLUMN_NAME": "formateur" + }, + { + "COLUMN_NAME": "COMMENT" + }, + { + "COLUMN_NAME": "formateurId" + }, + { + "COLUMN_NAME": "qrCodeToken" + } + ], + "messages": [], + "stdout": "COLUMN_NAME\nTABLE_CATALOG\nid\nformationId\nSEQUENCE_SCHEMA\nnom\nSEQUENCE_NAME\nlieu\nCACHE\ncapaciteMax\nCACHE_VALUE\ndateBlocage\nCYCLE\nstatut\nINCREMENT\ncreatedAt\nMAX_VALUE\nupdatedAt\nMIN_VALUE\npublicCible\nSTART\nformateur\nCOMMENT\nformateurId\nqrCodeToken\n", + "stderr": "", + "execution_time_ms": 209 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216639656.json b/.manus/db/db-query-1768216639656.json new file mode 100644 index 0000000..4b3a904 --- /dev/null +++ b/.manus/db/db-query-1768216639656.json @@ -0,0 +1,9 @@ +{ + "query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sequences' AND COLUMN_NAME LIKE '%bloq%';", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'sequences' AND COLUMN_NAME LIKE '%bloq%';", + "rows": [], + "messages": [], + "stdout": "", + "stderr": "", + "execution_time_ms": 123 +} \ No newline at end of file diff --git a/.manus/db/db-query-1768216661044.json b/.manus/db/db-query-1768216661044.json new file mode 100644 index 0000000..18265c3 --- /dev/null +++ b/.manus/db/db-query-1768216661044.json @@ -0,0 +1,9 @@ +{ + "query": "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' AND COLUMN_NAME LIKE '%active%';", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'apprenants' AND COLUMN_NAME LIKE '%active%';", + "rows": [], + "messages": [], + "stdout": "", + "stderr": "", + "execution_time_ms": 431 +} \ No newline at end of file diff --git a/.manus/db/db-query-error-1768216528173.json b/.manus/db/db-query-error-1768216528173.json new file mode 100644 index 0000000..3cbcaf7 --- /dev/null +++ b/.manus/db/db-query-error-1768216528173.json @@ -0,0 +1,8 @@ +{ + "query": "ALTER TABLE apprenants \nADD COLUMN codeEtablissement VARCHAR(50) NULL,\nADD COLUMN fonction VARCHAR(100) NULL;", + "command": "mysql --batch --raw --column-names --default-character-set=utf8mb4 --host gateway02.us-east-1.prod.aws.tidbcloud.com --port 4000 --user 4CrrYuB5tme73Qo.root --database 7PAT67UmWoxv8vwp8Bbcv6 --execute ALTER TABLE apprenants \nADD COLUMN codeEtablissement VARCHAR(50) NULL,\nADD COLUMN fonction VARCHAR(100) NULL;", + "returncode": 1, + "logs": [ + "ERROR 1060 (42S21) at line 1: Duplicate column name 'codeEtablissement'" + ] +} \ No newline at end of file diff --git a/drizzle/schema.ts b/drizzle/schema.ts index d7e7123..832d69d 100644 --- a/drizzle/schema.ts +++ b/drizzle/schema.ts @@ -74,8 +74,7 @@ export const sequences = mysqlTable("sequences", { nom: varchar("nom", { length: 255 }).notNull(), lieu: varchar("lieu", { length: 255 }).notNull(), capaciteMax: int("capaciteMax").notNull(), - dateBloquage: datetime("dateBloquage"), - statut: mysqlEnum("statut", ["ouverte", "fermee", "annulee"]).default("ouverte").notNull(), + statut: mysqlEnum("statut", ["ouverte", "bloquee", "terminee", "fermee", "annulee"]).default("ouverte").notNull(), /** Public cible de la séquence (Directeur, Chef de service, Autre, Tous) */ publicCible: mysqlEnum("publicCible", ["directeur", "chef_service", "autre", "tous"]).default("tous").notNull(), /** ID du formateur assigné à cette séquence */ @@ -114,11 +113,9 @@ export const apprenants = mysqlTable("apprenants", { nom: varchar("nom", { length: 255 }).notNull(), prenom: varchar("prenom", { length: 255 }).notNull(), email: varchar("email", { length: 320 }).notNull().unique(), - codeEtablissement: varchar("codeEtablissement", { length: 50 }).notNull(), + codeEtablissement: varchar("codeEtablissement", { length: 50 }), /** Fonction de l'apprenant (Directeur, Chef de service, Autre) */ - fonction: mysqlEnum("fonction", ["directeur", "chef_service", "autre"]).default("autre").notNull(), - /** Statut du compte (actif/inactif) */ - isActive: boolean("isActive").default(true).notNull(), + fonction: varchar("fonction", { length: 100 }), createdAt: timestamp("createdAt").defaultNow().notNull(), updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(), }); diff --git a/todo.md b/todo.md index f692877..2ce06ce 100644 --- a/todo.md +++ b/todo.md @@ -712,3 +712,10 @@ - [x] Ajouter DashboardLayout à toutes les pages formateur - [x] Vérifier que le menu s'affiche correctement pour le rôle formateur - [x] Tester la navigation dans l'espace formateur + +## Correction colonnes manquantes dans les tables + +- [x] Vérifier les colonnes manquantes dans la table apprenants +- [x] Vérifier les colonnes manquantes dans la table sequences +- [x] Ajouter les colonnes manquantes via SQL +- [x] Tester les requêtes sur le dashboard admin