File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,18 @@ spec:
4848
4949 echo "Copying user-defined migration scripts..."
5050 cp /custom-migrations/* /initdb.d/migrations/ || echo "Skip migrations"
51+ {{- if and .Values.db.migrations.enabled .Values.db.migrations.existingConfigMap }}
52+ echo "Copying external migrations from ConfigMap..."
53+ cp {{ .Values.db.migrations.mountPath }}/* /initdb.d/migrations/ || echo "No external migrations found"
54+ {{- end }}
5155 echo "Initialization scripts are ready"
5256 volumeMounts :
5357 - mountPath : /custom-init-scripts
5458 name : custom-init-scripts
55- - mountPath : /custom-migrations
59+ {{- if and .Values.db.migrations.enabled .Values.db.migrations.existingConfigMap }}
60+ - mountPath : {{ .Values.db.migrations.mountPath }}
5661 name : custom-migrations
62+ {{- end }}
5763 - mountPath : /initdb.d
5864 name : initdb-scripts-data
5965 containers :
@@ -158,6 +164,11 @@ spec:
158164 - name : custom-migrations
159165 configMap :
160166 name : {{ include "supabase.db.fullname" . }}-migrations
167+ {{- if and .Values.db.migrations.enabled .Values.db.migrations.existingConfigMap }}
168+ - name : user-migrations
169+ configMap :
170+ name : {{ .Values.db.migrations.existingConfigMap }}
171+ {{- end }}
161172 {{- with .Values.db.volumes }}
162173 {{- toYaml . | nindent 8 }}
163174 {{- end }}
Original file line number Diff line number Diff line change 183183 affinity : {}
184184 # Additional migration scripts can be defined here
185185 config : {}
186+ # Database migrations from external ConfigMap
187+ # Users should create ConfigMap before installing the chart:
188+ # kubectl create configmap my-migrations --from-file=./migrations/ -n namespace
189+ migrations :
190+ # Enable mounting external migrations ConfigMap
191+ enabled : true
192+ # Name of existing ConfigMap containing migration SQL files
193+ existingConfigMap : " custom-migrations"
194+ # Mount path for migrations in init container
195+ mountPath : /custom-migrations
186196
187197# Studio Application
188198studio :
You can’t perform that action at this time.
0 commit comments