diff --git a/package.json b/package.json index 84b2ecb..39473ec 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "version": "0.0.0-development", "scripts": { "prisma-studio": "(cd src-tauri && npx prisma studio)", - "prisma-generate-rust": "(cd src-tauri && cargo prisma generate)", + "prisma-generate-rust": "npm run cargo -- prisma generate", "cargo": "func() { (cd src-tauri && cargo \"$@\"); }; func", "prisma-prepare-schema-js": "node -r dotenv/config tools/prisma-prepare-schema.js src-tauri/prisma/schema.prisma dotenv_config_path=src-tauri/.env", "prisma-js": "npm run prisma-prepare-schema-js && npx prisma --", diff --git a/src-tauri/prisma/migrations/20230725155311_analyse_file/migration.sql b/src-tauri/prisma/migrations/20230725155311_analyse_file/migration.sql new file mode 100644 index 0000000..fbdbe93 --- /dev/null +++ b/src-tauri/prisma/migrations/20230725155311_analyse_file/migration.sql @@ -0,0 +1,26 @@ +/* + Warnings: + + - Added the required column `bpm` to the `File` table without a default value. This is not possible if the table is not empty. + - Added the required column `chordsKey` to the `File` table without a default value. This is not possible if the table is not empty. + - Added the required column `chordsScale` to the `File` table without a default value. This is not possible if the table is not empty. + - Added the required column `danceability` to the `File` table without a default value. This is not possible if the table is not empty. + +*/ +-- RedefineTables +PRAGMA foreign_keys=OFF; +CREATE TABLE "new_File" ( + "path" TEXT NOT NULL PRIMARY KEY, + "name" TEXT NOT NULL, + "directoryPath" TEXT NOT NULL, + "bpm" REAL NOT NULL, + "danceability" REAL NOT NULL, + "chordsKey" TEXT NOT NULL, + "chordsScale" TEXT NOT NULL, + CONSTRAINT "File_directoryPath_fkey" FOREIGN KEY ("directoryPath") REFERENCES "Directory" ("path") ON DELETE RESTRICT ON UPDATE CASCADE +); +INSERT INTO "new_File" ("directoryPath", "name", "path") SELECT "directoryPath", "name", "path" FROM "File"; +DROP TABLE "File"; +ALTER TABLE "new_File" RENAME TO "File"; +PRAGMA foreign_key_check; +PRAGMA foreign_keys=ON; diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index da501e9..f575fa7 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -34,10 +34,10 @@ async fn main() { .await .unwrap(); - #[cfg(debug_assertions)] + // #[cfg(debug_assertions)] prisma_client._db_push().await.unwrap(); - #[cfg(not(debug_assertions))] - prisma_client._migrate_deploy().await.unwrap(); + // #[cfg(not(debug_assertions))] + // prisma_client._migrate_deploy().await.unwrap(); handle.manage(AppState { prisma_client }) }); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d3ee429..1fd96d8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "pulp", - "version": "1.1.0" + "version": "1.0.6" }, "tauri": { "allowlist": {