fixed bug when there is no .env file and corrected prisma path

This commit is contained in:
qajus 2025-06-05 23:16:48 +02:00 committed by Rudi Regentonne
parent a68d43a7f3
commit 78cf086a47
4 changed files with 9 additions and 7 deletions

View file

@ -6,7 +6,7 @@
"echo generating prisma",
"yarn prisma generate",
"echo migrating database",
"yarn prisma migrate dev"
"yarn prisma migrate dev --name \"$(date +%Y%m%d%H%M%S)\""
],
"requiredKeys": [
{ "name": "DATABASE_URL", "generated": true },

View file

@ -33,11 +33,13 @@ if (fs.existsSync(".env")) {
missingConfigs.push(setting);
}
}
} else {
missingConfigs = config.requiredKeys;
}
if (missingConfigs.length < 1) {
// if it`s all set abort the installation
console.log("All required settings are already set in .env.");
if (missingConfigs.length < 1 ) {
// if it`s all set abort the installation
console.log("All required settings are already set in .env.");
} else {
// getting user input for the PostgreSQL username and password
console.log("generrating .env file");

View file

@ -2,7 +2,7 @@ import express, { Request, Response } from "express";
import dotenv from "dotenv";
import { StatusCodes } from "http-status-codes";
import { JwtPayload } from "jsonwebtoken";
import { PrismaClient, Post } from "@prisma/client";
import { PrismaClient, Post } from "../../prisma/app/generated/prisma/client";
import { minioClient } from "../server";
import { object } from "zod";
import { uploadPostSchema } from "../schemas/postSchemas";

View file

@ -1,5 +1,5 @@
import express, { Request, Response } from "express";
import { PrismaClient, User } from "@prisma/client";
import { PrismaClient, User } from "../../prisma/app/generated/prisma/client";
import { UserLoginDto, UserRegistrationDto } from "../schemas/userSchemas";
import jwt from "jsonwebtoken";
import dotenv from "dotenv";