Add PayU settings and dynamic QR generation
Some checks failed
build-and-deploy / build-deploy (push) Failing after 29s
Some checks failed
build-and-deploy / build-deploy (push) Failing after 29s
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package com.android.trisolarisserver.config
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class PayuSettingsSchemaFix(
|
||||
private val jdbcTemplate: JdbcTemplate
|
||||
) : PostgresSchemaFix(jdbcTemplate) {
|
||||
|
||||
override fun runPostgres(jdbcTemplate: JdbcTemplate) {
|
||||
val hasTable = jdbcTemplate.queryForObject(
|
||||
"""
|
||||
select count(*)
|
||||
from information_schema.tables
|
||||
where table_name = 'payu_settings'
|
||||
""".trimIndent(),
|
||||
Int::class.java
|
||||
) ?: 0
|
||||
if (hasTable == 0) {
|
||||
logger.info("Creating payu_settings table")
|
||||
jdbcTemplate.execute(
|
||||
"""
|
||||
create table payu_settings (
|
||||
id uuid primary key,
|
||||
property_id uuid not null unique references property(id) on delete cascade,
|
||||
merchant_key varchar not null,
|
||||
salt_32 varchar,
|
||||
salt_256 varchar,
|
||||
base_url varchar not null,
|
||||
use_salt_256 boolean not null default true,
|
||||
updated_at timestamptz not null
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user