static planning
This commit is contained in:
@ -36,3 +36,11 @@ npm run build
|
||||
You can preview the production build with `npm run preview`.
|
||||
|
||||
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
||||
|
||||
|
||||
|
||||
Pour créer la BDD en local :
|
||||
npm run init-db
|
||||
|
||||
Pour lancer l'application
|
||||
npm run dev
|
||||
Binary file not shown.
@ -1,35 +0,0 @@
|
||||
// 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.');
|
||||
@ -4,4 +4,14 @@ import { resolve } from 'path';
|
||||
// 📁 chemin absolu vers la BDD SQLite
|
||||
const db = new Database(resolve('data.db'));
|
||||
|
||||
db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS resource_planning (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
ressource TEXT NOT NULL,
|
||||
profil TEXT NOT NULL,
|
||||
date TEXT NOT NULL,
|
||||
disponibilite REAL NOT NULL
|
||||
);
|
||||
`);
|
||||
|
||||
export default db;
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
<a href="/" class:selected={current === "/"} title="Accueil">🏠</a>
|
||||
<a href="/gantt" class:selected={current === "/gantt"} title="Gantt">📅</a>
|
||||
<a href="/import" class:selected={current === "/import"} title="Importer">📂</a>
|
||||
<a href="/planning" class="block px-4 py-2 hover:bg-gray-100">📅</a>
|
||||
<a href="/config" class:selected={current === "/config"} title="Config">⚙️</a>
|
||||
</nav>
|
||||
<button class="reset-btn" on:click={resetData} title="Réinitialiser les données">
|
||||
|
||||
Reference in New Issue
Block a user