fix(ci): use connection URL with ssl:false in drizzle config
This commit is contained in:
@@ -52,15 +52,6 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install --ignore-scripts && deno install
|
run: npm install --ignore-scripts && deno install
|
||||||
|
|
||||||
- name: Debug connection
|
|
||||||
run: |
|
|
||||||
echo "--- pg_hba.conf ---"
|
|
||||||
sudo cat /etc/postgresql/*/main/pg_hba.conf | grep -v "^#" | grep -v "^$"
|
|
||||||
echo "--- listening ports ---"
|
|
||||||
sudo ss -tlnp | grep 5432 || echo "nothing on 5432"
|
|
||||||
echo "--- test connection ---"
|
|
||||||
PGPASSWORD=test psql -h localhost -U test -d polympr_test -c "SELECT 1" || echo "connection failed"
|
|
||||||
|
|
||||||
- name: Apply migrations
|
- name: Apply migrations
|
||||||
env:
|
env:
|
||||||
POSTGRES_HOST: localhost
|
POSTGRES_HOST: localhost
|
||||||
|
|||||||
+5
-5
@@ -1,15 +1,15 @@
|
|||||||
import { defineConfig } from "drizzle-kit";
|
import { defineConfig } from "drizzle-kit";
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
|
|
||||||
|
const url = process.env.DATABASE_URL ??
|
||||||
|
`postgresql://${process.env.POSTGRES_USER}:${process.env.POSTGRES_PASS}@${process.env.POSTGRES_HOST ?? "localhost"}:${process.env.POSTGRES_PORT ?? 5432}/${process.env.POSTGRES_DB}`;
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
dialect: "postgresql",
|
dialect: "postgresql",
|
||||||
schema: "./databases/schema.kit.ts",
|
schema: "./databases/schema.kit.ts",
|
||||||
out: "./databases/migrations",
|
out: "./databases/migrations",
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
host: process.env.POSTGRES_HOST!,
|
url,
|
||||||
port: Number(process.env.POSTGRES_PORT ?? 5432),
|
ssl: false,
|
||||||
user: process.env.POSTGRES_USER!,
|
|
||||||
password: process.env.POSTGRES_PASS!,
|
|
||||||
database: process.env.POSTGRES_DB!,
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user