Add database for library

This commit is contained in:
Myx
2025-03-28 04:46:29 +01:00
committed by Myx
parent c0cfca39a2
commit 35fd50c728
17 changed files with 382 additions and 80 deletions

View File

@@ -0,0 +1,10 @@
## Migrations
In order to create a new migration, there is a some steps to go through.
1. Run ``npm run migration:add --name <migration name>`` This currently work for Windows machines. If using Linux or Mac run this instead ``npx typeorm-ts-node-esm migration:generate ./src-electron/database/migrations/<migration name> -d ./src-electron/database/dataSource.ts``
2. Go to ``./src-electron/database/dataSource.ts`` and add the newly
generated migration to the migrations array and entity variables. In that way it will automatically apply the latest changes to the database on startup.
## The database
A Sqlite database file is automatically created on startup named Library, it will be placed in the same directory as the executable.