diff --git a/internal/pkg/storage/postgres.go b/internal/pkg/storage/postgres.go index 5f68329..ead05c2 100755 --- a/internal/pkg/storage/postgres.go +++ b/internal/pkg/storage/postgres.go @@ -54,6 +54,7 @@ email TEXT NOT NULL, cert_pem BYTEA NOT NULL, key_pem BYTEA NOT NULL, + full_chain_pem BYTEA DEFAULT '', -- Added: full_chain_pem account_key BYTEA NOT NULL, account_url TEXT NOT NULL, issuer_type TEXT DEFAULT '', @@ -72,14 +73,15 @@ } func (p *PostgresStrategy) SaveCertificateSQL(ph []string) string { - // ph[0]...ph[9] correspond to the 10 values + // ph[0]...ph[10] correspond to the 11 values return fmt.Sprintf(` - INSERT INTO certificates (domain, email, cert_pem, key_pem, account_key, account_url, issuer_type, secret_name, updated_at, enable_rotation, renew_before) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, now(), %s, %s) + INSERT INTO certificates (domain, email, cert_pem, key_pem, full_chain_pem, account_key, account_url, issuer_type, secret_name, updated_at, enable_rotation, renew_before) + VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, now(), %s, %s) ON CONFLICT (domain) DO UPDATE SET email = EXCLUDED.email, cert_pem = EXCLUDED.cert_pem, key_pem = EXCLUDED.key_pem, + full_chain_pem = EXCLUDED.full_chain_pem, account_key = EXCLUDED.account_key, account_url = EXCLUDED.account_url, issuer_type = EXCLUDED.issuer_type, @@ -87,7 +89,7 @@ updated_at = now(), enable_rotation = EXCLUDED.enable_rotation, renew_before = EXCLUDED.renew_before`, - ph[0], ph[1], ph[2], ph[3], ph[4], ph[5], ph[6], ph[7], ph[8], ph[9]) + ph[0], ph[1], ph[2], ph[3], ph[4], ph[5], ph[6], ph[7], ph[8], ph[9], ph[10]) } func (p *PostgresStrategy) SaveSecretSQL(ph []string) string {