This commit is contained in:
swrup 2025-11-16 02:01:35 +01:00
parent 4f2e77f27f
commit 0a0c5f8fd8
2 changed files with 24 additions and 8 deletions

View file

@ -1,3 +1,17 @@
download_source:
git clone --depth 1 https://git.taler.net/exchange.git/ ./exchange
mv ./exchange/src/exchangedb/*.sql ./
mv ./exchange/src/exchangedb/*.sql.in ./
rm -rf ./exchange
clean_source:
rm ./*.sql
rm ./*.sql.in
dbname := taler-exchange
sql_INIT := init.sql
sql_DROP := drop.sql
sql_DATA := \ sql_DATA := \
versioning.sql \ versioning.sql \
exchange-0001.sql \ exchange-0001.sql \
@ -7,8 +21,6 @@ sql_DATA := \
exchange-0005.sql \ exchange-0005.sql \
procedures.sql procedures.sql
sql_INIT := init.sql
procedures.sql: procedures.sql.in exchange_do_*.sql exchange_statistics_*.sql exchange_trigger_*.sql procedures.sql: procedures.sql.in exchange_do_*.sql exchange_statistics_*.sql exchange_trigger_*.sql
chmod +w $@ 2> /dev/null || true chmod +w $@ 2> /dev/null || true
gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@
@ -43,13 +55,17 @@ clean:
rm -f exchange-0004.sql rm -f exchange-0004.sql
rm $(sql_INIT) rm $(sql_INIT)
exec: gen_init # "NOTICE: function xxx() does not exist, skipping" are normal and expected
psql --host=localhost --port=5432 --username=mte --password --dbname="taler-exchange" --file=$(sql_INIT) init: gen_init
psql --host=localhost --port=5432 --username=mte --password --dbname=$(dbname) --file=$(sql_INIT)
drop:
psql --host=localhost --port=5432 --username=mte --password --dbname=$(dbname) --file=$(sql_DROP)
create_database: create_database:
createdb --host=localhost --port=5432 --username=mte --password "taler-exchange" createdb --host=localhost --port=5432 --username=mte --password $(dbname)
drop_database: drop_database:
dropdb --host=localhost --port=5432 --username=mte --password "taler-exchange" dropdb --host=localhost --port=5432 --username=mte --password $(dbname)
reset_database: drop_database create_database reset_database: drop_database create_database

View file

@ -300,14 +300,14 @@ LOOP
) VALUES ( ) VALUES (
in_decision_time in_decision_time
,ini_event); ,ini_event);
IF (ini-event = 'ACCOUNT_OPEN') IF (ini_event = 'ACCOUNT_OPEN')
THEN THEN
UPDATE kyc_targets UPDATE kyc_targets
SET open_time=in_decision_time SET open_time=in_decision_time
,close_time=NULL ,close_time=NULL
WHERE h_normalized_payto=in_h_normalized_payto; WHERE h_normalized_payto=in_h_normalized_payto;
END IF; END IF;
IF (ini-event = 'ACCOUNT_IDLE') IF (ini_event = 'ACCOUNT_IDLE')
THEN THEN
UPDATE kyc_targets UPDATE kyc_targets
SET close_time=in_decision_time SET close_time=in_decision_time