Fixed DB
Some checks failed
Build and Push Docker Images / build-backend (push) Failing after 28s
Build and Push Docker Images / build-frontend (push) Successful in 15s

This commit is contained in:
2026-01-08 11:10:02 +01:00
parent a892b7a6e4
commit 8126c2d3f4
4 changed files with 5 additions and 15 deletions

View File

@@ -1,21 +1,9 @@
import fp from "fastify-plugin"
import {drizzle, NodePgDatabase} from "drizzle-orm/node-postgres"
import { Pool } from "pg"
import * as schema from "../../db/schema"
import { db } from "../../db"
export default fp(async (server, opts) => {
const pool = new Pool({
host: "10.10.20.10",
port: Number(process.env.DB_PORT || 5432),
user: "postgres",
password: "wJw7aNpEBJdcxgoct6GXNpvY4Cn6ECqu",
database: "fedeo",
ssl: process.env.DB_DISABLE_SSL === "true" ? false : undefined,
})
// Drizzle instance
const db = drizzle(pool, { schema })
// Dekorieren -> überall server.db
server.decorate("db", db)