Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The table Search does not exist in the current database. #129

Open
MFYDev opened this issue Jul 15, 2024 · 3 comments
Open

The table Search does not exist in the current database. #129

MFYDev opened this issue Jul 15, 2024 · 3 comments

Comments

@MFYDev
Copy link

MFYDev commented Jul 15, 2024

Hi, I am trying to selfhost and got this error when I search

The table `Search` does not exist in the current database.
    at In.handleRequestError (/app/node_modules/@prisma/client/runtime/library.js:122:6854)
    at In.handleAndLogRequestError (/app/node_modules/@prisma/client/runtime/library.js:122:6188)
    at In.request (/app/node_modules/@prisma/client/runtime/library.js:122:5896)
    at async l (/app/node_modules/@prisma/client/runtime/library.js:127:11167)
    at async PlanetScaleCache.getSearchResults (/app/.next/server/chunks/9432.js:1:3913)
    at async handler (/app/.next/server/pages/api/search/title.js:1:3867) {
  code: 'P2021',
  clientVersion: '5.13.0',
  meta: { modelName: 'Search', table: 'Search' }
}
encountered a search issue PrismaClientKnownRequestError: 
Invalid `prisma.search.findUnique()` invocation:

I am using docker compose and here is mine

services:
  tor:
    image: debridmediamanager/tor
    container_name: debridmediamanager-tor
    restart: always
    deploy:
      replicas: 1

  web:
    image: debridmediamanager/debrid-media-manager:latest
    container_name: debridmediamanager
    restart: always
    ports:
      - 9898:3000
    env_file:
      - .env
    depends_on:
      - mysql
      - tor
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
  
  mysql:
    image: mysql:latest
    container_name: debridmediamanager-mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: debridmediamanager
      MYSQL_DATABASE: debridmediamanager
      MYSQL_USER: debridmediamanager
      MYSQL_PASSWORD: debridmediamanager
    volumes:
      - ./mysql:/var/lib/mysql
@MMagTech
Copy link

Self hosting here as well. Had the same issue. You need to use an app like adminer and add all the columns and table manually to the database. You can find the entires needed and how they are input here https://github.com/debridmediamanager/debrid-media-manager/blob/main/prisma/schema.prisma

Ends up looking like this as an exapmle.

Screenshot 2024-08-19 141752

Screenshot 2024-08-19 141445

@phirestalker
Copy link

phirestalker commented Aug 20, 2024 via email

@nicopowa
Copy link

nicopowa commented Nov 7, 2024

Hi

This project is incredible !

Setting up self hosted Docker instance right now, not fully functional yet, very soon I hope :)

Steps to initialize database :

  • clone DebridMediaManager repo
  • read this comment
  • run npm install
  • convert Prisma schema to SQL
    npx prisma migrate diff --from-empty --to-schema-datamodel ./prisma/schema.prisma --script > ./prisma/nothankyou.sql
  • inject into MySQL container
    cat ./prisma/nothankyou.sql | docker exec -i {CONTAINER_NAME} /usr/bin/mysql -u {MYSQL_USER} --password={MYSQL_PASSWORD} {DATABASE_NAME}
  • restart Docker stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants