diff --git a/config/database.js b/config/database.js
index 50274a2..0253423 100644
--- a/config/database.js
+++ b/config/database.js
@@ -81,7 +81,7 @@ function initDatabase() {
logger.info('✓ Tables de base de données créées avec succès');
- // Migration: Ajouter image_filename si elle n'existe pas
+ // Migrations automatiques
db.all("PRAGMA table_info(notes)", (err, columns) => {
if (err) {
logger.error('Erreur lors de la vérification de la structure de la table notes:', err);
@@ -89,6 +89,7 @@ function initDatabase() {
}
const hasImageFilename = columns.some(col => col.name === 'image_filename');
+ const hasArchived = columns.some(col => col.name === 'archived');
if (!hasImageFilename) {
logger.info('Migration: Ajout de la colonne image_filename...');
@@ -100,6 +101,17 @@ function initDatabase() {
}
});
}
+
+ if (!hasArchived) {
+ logger.info('Migration: Ajout de la colonne archived...');
+ db.run('ALTER TABLE notes ADD COLUMN archived BOOLEAN DEFAULT 0', (err) => {
+ if (err) {
+ logger.error('Erreur lors de l\'ajout de la colonne archived:', err);
+ } else {
+ logger.info('✓ Colonne archived ajoutée avec succès');
+ }
+ });
+ }
});
// Créer l'utilisateur admin par défaut si la table est vide
diff --git a/public/index.html b/public/index.html
index 540e372..b27f5f3 100644
--- a/public/index.html
+++ b/public/index.html
@@ -84,20 +84,38 @@
Notes
-
+