From df8688939daf38a19acb349252d408ba8a400ec8 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 28 Apr 2025 20:06:18 +0200 Subject: [PATCH] use database up, down, reset and clear only direct with tsx, builded version don't work anymore --- .github/workflows/test_database.yml | 30 +---------------------------- database/package.json | 9 +++------ database/src/config/index.ts | 2 +- database/turbo.json | 9 --------- 4 files changed, 5 insertions(+), 45 deletions(-) diff --git a/.github/workflows/test_database.yml b/.github/workflows/test_database.yml index ef383b73b..b6404062d 100644 --- a/.github/workflows/test_database.yml +++ b/.github/workflows/test_database.yml @@ -80,40 +80,12 @@ jobs: - name: Database | reset run: cd out && turbo reset - + lint: if: needs.files-changed.outputs.database == 'true' name: Lint - Database Up needs: files-changed runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Database | Lint - run: cd database && yarn && yarn run lint - - lint_bun: - if: needs.files-changed.outputs.database == 'true' - name: Lint - Database Up (Bun) - needs: files-changed - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Database | Lint - run: bun install && cd database && bun run lint - - lint_turbo: - if: needs.files-changed.outputs.database == 'true' - name: Lint - Database Up (Turbo) - needs: files-changed - runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 diff --git a/database/package.json b/database/package.json index 96d2d11c7..8bfa68c78 100644 --- a/database/package.json +++ b/database/package.json @@ -17,13 +17,10 @@ "scripts": { "build": "mkdirp build/src/config/ && ncp src/config build/src/config && tsc --build", "clean": "tsc --build --clean", - "up": "cross-env TZ=UTC node build/src/index.js up", - "down": "cross-env TZ=UTC node build/src/index.js down", - "reset": "cross-env TZ=UTC node build/src/index.js reset", + "up": "cross-env TZ=UTC tsx src/index.ts up", + "down": "cross-env TZ=UTC tsx src/index.ts down", + "reset": "cross-env TZ=UTC tsx src/index.ts reset", "clear": "cross-env TZ=UTC tsx src/index.ts clear", - "dev_up": "cross-env TZ=UTC tsx src/index.ts up", - "dev_down": "cross-env TZ=UTC tsx src/index.ts down", - "dev_reset": "cross-env TZ=UTC tsx src/index.ts reset", "lint": "eslint --max-warnings=0 --ext .js,.ts .", "up:backend_test": "cross-env TZ=UTC DB_DATABASE=gradido_test_backend tsx src/index.ts up", "up:federation_test": "cross-env TZ=UTC DB_DATABASE=gradido_test_federation tsx src/index.ts up", diff --git a/database/src/config/index.ts b/database/src/config/index.ts index 1a5fb08ed..25ce9b741 100644 --- a/database/src/config/index.ts +++ b/database/src/config/index.ts @@ -14,7 +14,7 @@ const constants = { const database = { DB_HOST: process.env.DB_HOST || 'localhost', - DB_PORT: process.env.DB_PORT ? parseInt(process.env.DB_PORT) : 3306, + DB_PORT: process.env.DB_PORT ? Number.parseInt(process.env.DB_PORT) : 3306, DB_USER: process.env.DB_USER || 'root', DB_PASSWORD: process.env.DB_PASSWORD || '', DB_DATABASE: process.env.DB_DATABASE || 'gradido_community', diff --git a/database/turbo.json b/database/turbo.json index fdd0a3b62..accbef05d 100644 --- a/database/turbo.json +++ b/database/turbo.json @@ -17,15 +17,6 @@ "up:dht_test": { "dependsOn": ["commonConfig"] }, - "dev_up": { - "dependsOn": ["commonConfig"] - }, - "dev_down": { - "dependsOn": ["commonConfig"] - }, - "dev_reset": { - "dependsOn": ["commonConfig"] - }, "up": { "dependsOn": ["commonConfig", "build"] },