diff --git a/backend/knexfile.js b/backend/knexfile.js new file mode 100644 index 0000000..6c2dc27 --- /dev/null +++ b/backend/knexfile.js @@ -0,0 +1,14 @@ +export default { + client: 'better-sqlite3', + connection: { + filename: process.env.DB_PATH || './data/cv.db' + }, + migrations: { + directory: './migrations', + tableName: 'knex_migrations' + }, + seeds: { + directory: './seeds' + }, + useNullAsDefault: true +}; diff --git a/backend/seeds/initial_cv_data.js b/backend/seeds/initial_cv_data.js new file mode 100644 index 0000000..4cc3671 --- /dev/null +++ b/backend/seeds/initial_cv_data.js @@ -0,0 +1,24 @@ +export async function seed(knex) { + const existing = await knex('cv_data').where({ id: 1 }).first(); + + if (!existing) { + await knex('cv_data').insert({ + id: 1, + data: JSON.stringify({ + personal: { + name: "Tuan-Dat Tran", + title: "Junior DevOps Engineer", + intro: "Passionierter DevOps Engineer mit Fokus auf Cloud-Infrastruktur, Container-Orchestrierung und automatisierte Deployment-Pipelines.", + email: "tuan-dat.tran@example.com", + github: "https://github.com/tuan-dat-tran", + linkedin: "https://linkedin.com/in/tuan-dat-tran", + location: "Deutschland" + }, + experience: [], + skills: {}, + education: [], + projects: [] + }) + }); + } +}