© 2026 Hedgehog Software, LLC
pnpm drizzle-kit migrate
migrations applied
import "dotenv/config"; import { Pool, neonConfig } from "@neondatabase/serverless"; import { drizzle } from "drizzle-orm/neon-serverless"; import { WebSocket } from "ws"; import * as schema from "./schema"; if (process.env.NODE_ENV === "production") { neonConfig.webSocketConstructor = WebSocket; neonConfig.poolQueryViaFetch = true; } else { neonConfig.webSocketConstructor = WebSocket; neonConfig.wsProxy = (host) => `${host}:5433/v1`; neonConfig.useSecureWebSocket = false; neonConfig.pipelineTLS = false; neonConfig.pipelineConnect = false; } const pool = new Pool({ connectionString: process.env.DATABASE_URL }); export const db = drizzle(pool, { schema }); export type db = typeof db;
services: postgres: image: 'postgres:17' environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres ports: - '5432:5432' pg_proxy: image: ghcr.io/neondatabase/wsproxy:latest environment: APPEND_PORT: 'postgres:5432' ALLOW_ADDR_REGEX: '.*' LOG_TRAFFIC: 'true' ports: - '5433:80' depends_on: - postgres
import "dotenv/config"; import { defineConfig } from "drizzle-kit"; export default defineConfig({ schema: "./lib/db/schema/index.ts", out: "./lib/db/migrations", dialect: "postgresql", dbCredentials: { url: process.env.DATABASE_URL!, }, });