Initial commit

This commit is contained in:
Bastien COIGNOUX
2025-07-14 14:14:48 +02:00
commit f999b17150
31 changed files with 3018 additions and 0 deletions

View File

@ -0,0 +1,35 @@
// scripts/init-db.ts
import Database from 'better-sqlite3';
import { mkdirSync, existsSync } from 'fs';
if (!existsSync('data')) {
mkdirSync('data');
}
const db = new Database('data.db');
db.exec(`
DROP TABLE IF EXISTS tasks;
DROP TABLE IF EXISTS links;
CREATE TABLE tasks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT NOT NULL,
start TEXT NOT NULL,
end TEXT NOT NULL,
duration INTEGER,
progress INTEGER,
type TEXT,
parent INTEGER,
lazy BOOLEAN DEFAULT 0 -- ✅ Ajout ici
);
CREATE TABLE links (
id INTEGER PRIMARY KEY AUTOINCREMENT,
source INTEGER,
target INTEGER,
type TEXT
);
`);
console.log('✅ Base de données initialisée avec succès.');