Add job migration
This commit is contained in:
parent
36e6ab76d7
commit
7f0b0c7a3b
21
charts/dateme-chart/templates/db-migration-job.yaml
Normal file
21
charts/dateme-chart/templates/db-migration-job.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-db-migration
|
||||||
|
namespace: {{ .Values.global.namespace }}
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
containers:
|
||||||
|
- name: migrate
|
||||||
|
image: postgres:16-alpine
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
echo "Running DB migration: add display_name to profiles..."
|
||||||
|
psql -h {{ .Release.Name }}-{{ .Values.postgres.name }}-headless -U {{ .Values.postgres.user }} -d {{ .Values.postgres.database }} -c "ALTER TABLE profiles ADD COLUMN IF NOT EXISTS display_name TEXT;"
|
||||||
|
env:
|
||||||
|
- name: PGPASSWORD
|
||||||
|
value: {{ .Values.postgres.password | quote }}
|
||||||
Loading…
x
Reference in New Issue
Block a user