init: adding additional script

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-06-05 14:31:40 +02:00
parent 8d8b9fbbae
commit 5650471d72
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
2 changed files with 5 additions and 0 deletions

View File

@ -24,12 +24,14 @@ postgres_ha_databases:
- name: my-db - name: my-db
user: my-user user: my-user
pass: my-pass pass: my-pass
script: 'CREATE SCHEMA IF NOT EXIST example;'
- name: my-other-db - name: my-other-db
user: my-other-user user: my-other-user
pass: my-other-pass pass: my-other-pass
``` ```
The `user` field is optional. DB name is used by default. The `user` field is optional. DB name is used by default.
The field `script` is optional and allow to add commands to run when creating the database.
Backup settings can be adjusted using: Backup settings can be adjusted using:
```yaml ```yaml

View File

@ -13,4 +13,7 @@ LOCALE "{{ db.locale }}"
TEMPLATE "{{ db.template }}" TEMPLATE "{{ db.template }}"
{% endif %} {% endif %}
; ;
{% if 'script' in db %}
{{ db.script }}
{% endif %}
{% endfor %} {% endfor %}