mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
fix(database): revert changes related to db URL (#1185)
* fix(database): revert changes related to db URL * cleanup
This commit is contained in:
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@@ -74,5 +74,4 @@ jobs:
|
||||
working-directory: ./apps/sim
|
||||
env:
|
||||
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
|
||||
DATABASE_SSL_CERT: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_SSL_CERT || '' }}
|
||||
run: bunx drizzle-kit migrate
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
import type { Config } from 'drizzle-kit'
|
||||
import { env } from './lib/env'
|
||||
|
||||
const connectionString = env.POSTGRES_URL ?? env.DATABASE_URL
|
||||
|
||||
let sslConfig: { rejectUnauthorized: boolean; ca: string } | undefined
|
||||
if (env.DATABASE_SSL_CERT) {
|
||||
sslConfig = { rejectUnauthorized: true, ca: env.DATABASE_SSL_CERT }
|
||||
}
|
||||
|
||||
export default {
|
||||
schema: './db/schema.ts',
|
||||
out: './db/migrations',
|
||||
dialect: 'postgresql',
|
||||
dbCredentials: {
|
||||
url: connectionString,
|
||||
ssl: sslConfig,
|
||||
url: env.DATABASE_URL,
|
||||
},
|
||||
} satisfies Config
|
||||
|
||||
@@ -16,8 +16,7 @@ export const env = createEnv({
|
||||
|
||||
server: {
|
||||
// Core Database & Authentication
|
||||
DATABASE_URL: z.string().url(), // Primary database connection string (without SSL cert)
|
||||
DATABASE_SSL_CERT: z.string().optional(), // SSL certificate content for database connection
|
||||
DATABASE_URL: z.string().url(), // Primary database connection string
|
||||
BETTER_AUTH_URL: z.string().url(), // Base URL for Better Auth service
|
||||
BETTER_AUTH_SECRET: z.string().min(32), // Secret key for Better Auth JWT signing
|
||||
DISABLE_REGISTRATION: z.boolean().optional(), // Flag to disable new user registration
|
||||
|
||||
Reference in New Issue
Block a user