Derive PayU return URLs from property
Some checks failed
build-and-deploy / build-deploy (push) Failing after 30s
Some checks failed
build-and-deploy / build-deploy (push) Failing after 30s
This commit is contained in:
@@ -28,40 +28,11 @@ class PayuSettingsSchemaFix(
|
||||
salt_32 varchar,
|
||||
salt_256 varchar,
|
||||
base_url varchar not null,
|
||||
success_url varchar not null,
|
||||
failure_url varchar not null,
|
||||
use_salt_256 boolean not null default true,
|
||||
updated_at timestamptz not null
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
val hasSuccessUrl = jdbcTemplate.queryForObject(
|
||||
"""
|
||||
select count(*)
|
||||
from information_schema.columns
|
||||
where table_name = 'payu_settings'
|
||||
and column_name = 'success_url'
|
||||
""".trimIndent(),
|
||||
Int::class.java
|
||||
) ?: 0
|
||||
if (hasSuccessUrl == 0) {
|
||||
logger.info("Adding payu_settings.success_url column")
|
||||
jdbcTemplate.execute("alter table payu_settings add column success_url varchar")
|
||||
}
|
||||
|
||||
val hasFailureUrl = jdbcTemplate.queryForObject(
|
||||
"""
|
||||
select count(*)
|
||||
from information_schema.columns
|
||||
where table_name = 'payu_settings'
|
||||
and column_name = 'failure_url'
|
||||
""".trimIndent(),
|
||||
Int::class.java
|
||||
) ?: 0
|
||||
if (hasFailureUrl == 0) {
|
||||
logger.info("Adding payu_settings.failure_url column")
|
||||
jdbcTemplate.execute("alter table payu_settings add column failure_url varchar")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user