@@ -226,10 +226,10 @@ def gzip_then_base64_encode(s: str) -> str:
226
226
- {{path: /etc/gotrue.env, content: { gzip_then_base64_encode (gotrue_env_content )} , permissions: '0664', encoding: gz+b64}}
227
227
- {{path: /etc/wal-g/config.json, content: { gzip_then_base64_encode (walg_config_json_content )} , permissions: '0664', owner: 'wal-g:wal-g', encoding: gz+b64}}
228
228
- {{path: /tmp/init.json, content: { gzip_then_base64_encode (init_json_content )} , permissions: '0600', encoding: gz+b64}}
229
- - {{path: /root/pg_extensions.json, content: { gzip_then_base64_encode ('{"pg_cron":"1.3.1"}' )} , permissions: '0644', encoding: gz+b64}}
230
229
runcmd:
231
230
- 'sudo echo \" pgbouncer\" \" postgres\" >> /etc/pgbouncer/userlist.txt'
232
231
- 'cd /tmp && aws s3 cp --region ap-southeast-1 s3://init-scripts-staging/project/init.sh .'
232
+ - 'if [ "$POSTGRES_MAJOR_VERSION" = "15" ]; then echo \' { "pg_cron" :"1.3.1"} \' | sudo tee /root/pg_extensions.json && sudo chmod 644 /root/pg_extensions.json; fi'
233
233
- 'bash init.sh "staging"'
234
234
- 'rm -rf /tmp/*'
235
235
""" ,
@@ -480,6 +480,11 @@ def test_postgrest_ending_empty_key_query_parameter_is_removed(host):
480
480
481
481
482
482
def test_pg_cron_extension (host ):
483
+ # Only run this test for PostgreSQL 15
484
+ postgres_version = os .environ .get ("POSTGRES_MAJOR_VERSION" )
485
+ if postgres_version != "15" :
486
+ pytest .skip (f"Skipping pg_cron test for PostgreSQL version { postgres_version } " )
487
+
483
488
# Connect as supabase_admin and create the extension
484
489
with host .sudo ("postgres" ):
485
490
result = host .run ('psql -U supabase_admin -d postgres -c "CREATE EXTENSION pg_cron WITH SCHEMA pg_catalog VERSION \' 1.3.1\' ;"' )
0 commit comments