Checkpoint: Boîte à idées : table BDD, API tRPC (créer, lister, répondre, changer statut), page avec liste filtrée par statut et recherche, bouton Nouvelle demande, réponse admin avec statut colorisé, menu dans la sidebar
This commit is contained in:
@@ -115,3 +115,22 @@ export const importLogs = mysqlTable("import_logs", {
|
||||
|
||||
export type ImportLog = typeof importLogs.$inferSelect;
|
||||
export type InsertImportLog = typeof importLogs.$inferInsert;
|
||||
|
||||
// ─── Boîte à idées ───────────────────────────────────────────────────────────
|
||||
|
||||
export const ideas = mysqlTable("ideas", {
|
||||
id: int("id").autoincrement().primaryKey(),
|
||||
userId: int("userId").notNull(),
|
||||
userName: varchar("userName", { length: 255 }).notNull(),
|
||||
titre: varchar("titre", { length: 512 }).notNull(),
|
||||
message: text("message").notNull(),
|
||||
statut: mysqlEnum("statut", ["ouvert", "en_cours", "resolu", "ferme"]).default("ouvert").notNull(),
|
||||
reponseAdmin: text("reponseAdmin"),
|
||||
reponduPar: varchar("reponduPar", { length: 255 }),
|
||||
reponduAt: timestamp("reponduAt"),
|
||||
createdAt: timestamp("createdAt").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow().onUpdateNow().notNull(),
|
||||
});
|
||||
|
||||
export type Idea = typeof ideas.$inferSelect;
|
||||
export type InsertIdea = typeof ideas.$inferInsert;
|
||||
|
||||
Reference in New Issue
Block a user