- Drop @supabase/supabase-js entirely; add drizzle-orm + postgres (porsager) driver - New packages/db: schema (pgSchema ordinarthur_os), client factory, migrate runner, drizzle-kit config - SQL migrations: 0000_init (pgcrypto + schema), 0001_jobs (jobs + job_search_criteria, no RLS) - Rewrite apps/api db module with DI symbols DB/DB_HANDLE + @InjectDb() decorator - Rewrite jobs.service.ts with Drizzle queries (upsert via onConflictDoUpdate, arrayOverlaps for stack filter) - Replace SUPABASE_* env vars with DATABASE_URL in env config + .env.example - Add docker-compose.yml (Postgres 16-alpine, dev only) - Add deploy/k8s/postgres.yaml (StatefulSet + PVC), migrate.job.yaml, updated secrets.template.yaml - Update all docs (README, PLAN, ARCHITECTURE, CLAUDE.md, AGENTS.md, packages/db/README.md) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
28 lines
969 B
YAML
28 lines
969 B
YAML
# Job one-shot qui applique les migrations Drizzle.
|
|
# À rejouer manuellement après chaque déploiement qui contient une migration :
|
|
# kubectl -n ordinarthur-os delete job ordinarthur-os-migrate --ignore-not-found
|
|
# kubectl -n ordinarthur-os apply -f migrate.job.yaml
|
|
#
|
|
# (Peut aussi être branché dans le pipeline Gitea pour être auto-déclenché.)
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: ordinarthur-os-migrate
|
|
namespace: ordinarthur-os
|
|
spec:
|
|
backoffLimit: 2
|
|
ttlSecondsAfterFinished: 86400
|
|
template:
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: migrate
|
|
image: gitea.arthurbarre.fr/arthurbarre/ordinarthur-os-migrate:latest
|
|
imagePullPolicy: Always
|
|
envFrom:
|
|
- secretRef: { name: ordinarthur-os-secrets }
|
|
command: ["node", "dist/migrate.js"]
|
|
resources:
|
|
requests: { cpu: 50m, memory: 128Mi }
|
|
limits: { cpu: 300m, memory: 256Mi }
|