@@ -41,20 +41,22 @@ type ConfigResponse struct {
4141 CrunchyBridgeAPIKey string `json:"crunchy_bridge_api_key"`
4242 CrunchyBridgeClusterName string `json:"crunchy_bridge_cluster_name"`
4343 CrunchyBridgeDatabaseName string `json:"crunchy_bridge_database_name"`
44+ PostRestoreSQL string `json:"post_restore_sql"`
4445}
4546
4647// UpdateConfigRequest represents the request to update configuration
4748type UpdateConfigRequest struct {
48- ConnectionString string `json:"connectionString"`
49- PostgresVersion string `json:"postgresVersion"`
50- SchemaOnly * bool `json:"schemaOnly"`
51- RefreshSchedule string `json:"refreshSchedule"`
52- Domain string `json:"domain"`
53- LetsEncryptEmail string `json:"letsEncryptEmail"`
54- MaxRestores * int `json:"maxRestores"`
55- CrunchyBridgeAPIKey string `json:"crunchyBridgeApiKey"`
56- CrunchyBridgeClusterName string `json:"crunchyBridgeClusterName"`
57- CrunchyBridgeDatabaseName string `json:"crunchyBridgeDatabaseName"`
49+ ConnectionString string `json:"connectionString"`
50+ PostgresVersion string `json:"postgresVersion"`
51+ SchemaOnly * bool `json:"schemaOnly"`
52+ RefreshSchedule string `json:"refreshSchedule"`
53+ Domain string `json:"domain"`
54+ LetsEncryptEmail string `json:"letsEncryptEmail"`
55+ MaxRestores * int `json:"maxRestores"`
56+ CrunchyBridgeAPIKey string `json:"crunchyBridgeApiKey"`
57+ CrunchyBridgeClusterName string `json:"crunchyBridgeClusterName"`
58+ CrunchyBridgeDatabaseName string `json:"crunchyBridgeDatabaseName"`
59+ PostRestoreSQL * string `json:"postRestoreSQL"`
5860}
5961
6062// @Summary Get configuration
@@ -94,6 +96,7 @@ func (s *Server) getConfig(c *gin.Context) {
9496 CrunchyBridgeAPIKey : redactSecret (config .CrunchyBridgeAPIKey ),
9597 CrunchyBridgeClusterName : config .CrunchyBridgeClusterName ,
9698 CrunchyBridgeDatabaseName : config .CrunchyBridgeDatabaseName ,
99+ PostRestoreSQL : config .PostRestoreSQL ,
97100 })
98101}
99102
@@ -261,6 +264,11 @@ func (s *Server) updateConfig(c *gin.Context) {
261264 config .Domain = req .Domain
262265 config .LetsEncryptEmail = req .LetsEncryptEmail
263266
267+ // Update post-restore SQL if provided (allow empty string to clear)
268+ if req .PostRestoreSQL != nil {
269+ config .PostRestoreSQL = * req .PostRestoreSQL
270+ }
271+
264272 // If domain is set, configure Caddy with Let's Encrypt
265273 if req .Domain != "" {
266274 if err := s .configureCaddy (req .Domain , req .LetsEncryptEmail ); err != nil {
@@ -299,6 +307,7 @@ func (s *Server) updateConfig(c *gin.Context) {
299307 CrunchyBridgeAPIKey : redactSecret (config .CrunchyBridgeAPIKey ),
300308 CrunchyBridgeClusterName : config .CrunchyBridgeClusterName ,
301309 CrunchyBridgeDatabaseName : config .CrunchyBridgeDatabaseName ,
310+ PostRestoreSQL : config .PostRestoreSQL ,
302311 })
303312}
304313
0 commit comments