diff options
author | Florian Dold <florian@dold.me> | 2024-08-28 21:38:18 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-08-28 21:38:18 +0200 |
commit | 96381a2511293f07fbd8f226112530c43fe71d48 (patch) | |
tree | 18b2e101e7384293078dfedd05d17ac432cc2f2a | |
parent | ca41d6a906e63658fafb10056da2630b41229717 (diff) |
Revert "updated table creation files"
This reverts commit ca41d6a906e63658fafb10056da2630b41229717.
25 files changed, 57 insertions, 80 deletions
diff --git a/src/auditordb/0002-auditor_amount_arithmetic_inconsistency.sql b/src/auditordb/0002-auditor_amount_arithmetic_inconsistency.sql index 286f612bc..69b64bc41 100644 --- a/src/auditordb/0002-auditor_amount_arithmetic_inconsistency.sql +++ b/src/auditordb/0002-auditor_amount_arithmetic_inconsistency.sql @@ -19,13 +19,12 @@ CREATE TABLE auditor_amount_arithmetic_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, -- TODO: correct constraintcheck, currently wrong --operation BYTEA NOT NULL CHECK (LENGTH(operation)=16), operation TEXT NOT NULL PRIMARY KEY, - exchange_amount taler_amount NOT NULL, - auditor_amount taler_amount NOT NULL, - profitable BOOLEAN NOT NULL, + exchange_amount taler_amount, + auditor_amount taler_amount, + profitable BOOLEAN, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_amount_arithmetic_inconsistency diff --git a/src/auditordb/0002-auditor_bad_sig_losses.sql b/src/auditordb/0002-auditor_bad_sig_losses.sql index 8be983670..c5a222251 100644 --- a/src/auditordb/0002-auditor_bad_sig_losses.sql +++ b/src/auditordb/0002-auditor_bad_sig_losses.sql @@ -18,9 +18,8 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_bad_sig_losses ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, - operation TEXT NOT NULL, - loss taler_amount NOT NULL, + operation TEXT, + loss taler_amount, operation_specific_pub BYTEA NOT NULL CHECK (LENGTH(operation_specific_pub)=32), suppressed BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (operation, operation_specific_pub) diff --git a/src/auditordb/0002-auditor_balances.sql b/src/auditordb/0002-auditor_balances.sql index e25c3049c..78ff8a414 100644 --- a/src/auditordb/0002-auditor_balances.sql +++ b/src/auditordb/0002-auditor_balances.sql @@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS auditor_balances ( - row_id BIGINT GENERATED BY DEFAULT AS IDENTITY, + row_id BIGINT GENERATED BY DEFAULT AS IDENTITY, balance_key TEXT PRIMARY KEY NOT NULL, balance_value taler_amount diff --git a/src/auditordb/0002-auditor_closure_lags.sql b/src/auditordb/0002-auditor_closure_lags.sql index d41a55eae..93484f399 100644 --- a/src/auditordb/0002-auditor_closure_lags.sql +++ b/src/auditordb/0002-auditor_closure_lags.sql @@ -18,11 +18,10 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_closure_lags ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - amount taler_amount NOT NULL, - deadline BIGINT NOT NULL, - wtid BYTEA NOT NULL, - account BYTEA NOT NULL, + amount taler_amount, + deadline BIGINT, + wtid BYTEA, + account BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_closure_lags diff --git a/src/auditordb/0002-auditor_coin_inconsistency.sql b/src/auditordb/0002-auditor_coin_inconsistency.sql index c9c1b02fc..ea5210d68 100644 --- a/src/auditordb/0002-auditor_coin_inconsistency.sql +++ b/src/auditordb/0002-auditor_coin_inconsistency.sql @@ -18,12 +18,11 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_coin_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, operation TEXT NOT NULL, - exchange_amount taler_amount NOT NULL, - auditor_amount taler_amount NOT NULL, + exchange_amount taler_amount, + auditor_amount taler_amount, coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32), - profitable BOOLEAN NOT NULL, + profitable BOOLEAN, suppressed BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (operation, coin_pub) ); diff --git a/src/auditordb/0002-auditor_denomination_key_validity_withdraw_inconsistency.sql b/src/auditordb/0002-auditor_denomination_key_validity_withdraw_inconsistency.sql index 4c91eded6..029bc90e0 100644 --- a/src/auditordb/0002-auditor_denomination_key_validity_withdraw_inconsistency.sql +++ b/src/auditordb/0002-auditor_denomination_key_validity_withdraw_inconsistency.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_denomination_key_validity_withdraw_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, execution_date BIGINT, - reserve_pub BYTEA NOT NULL, - denompub_h BYTEA NOT NULL, + reserve_pub BYTEA, + denompub_h BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_denomination_key_validity_withdraw_inconsistency diff --git a/src/auditordb/0002-auditor_denominations_without_sigs.sql b/src/auditordb/0002-auditor_denominations_without_sigs.sql index 77dc3b153..94ea0a351 100644 --- a/src/auditordb/0002-auditor_denominations_without_sigs.sql +++ b/src/auditordb/0002-auditor_denominations_without_sigs.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_denominations_without_sigs ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, denompub_h BYTEA PRIMARY KEY, - value taler_amount NOT NULL, - start_time BIGINT NOT NULL, + value taler_amount, + start_time BIGINT, end_time BIGINT, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); diff --git a/src/auditordb/0002-auditor_deposit_confirmations.sql b/src/auditordb/0002-auditor_deposit_confirmations.sql index 2c9bbf951..7e47b4fd1 100644 --- a/src/auditordb/0002-auditor_deposit_confirmations.sql +++ b/src/auditordb/0002-auditor_deposit_confirmations.sql @@ -16,7 +16,6 @@ CREATE TABLE auditor_deposit_confirmations (deposit_confirmation_serial_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE - ,problem_row_id BIGINT NOT NULL ,h_contract_terms BYTEA NOT NULL CHECK (LENGTH(h_contract_terms)=64) ,h_policy BYTEA NOT NULL CHECK (LENGTH(h_policy)=64) ,h_wire BYTEA NOT NULL CHECK (LENGTH(h_wire)=64) diff --git a/src/auditordb/0002-auditor_emergency.sql b/src/auditordb/0002-auditor_emergency.sql index a97befc0b..5fcd3cd06 100644 --- a/src/auditordb/0002-auditor_emergency.sql +++ b/src/auditordb/0002-auditor_emergency.sql @@ -20,13 +20,12 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_emergency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, denompub_h BYTEA CHECK (LENGTH(denompub_h)=64), - denom_risk taler_amount NOT NULL, - denom_loss taler_amount NOT NULL, - deposit_start BIGINT NOT NULL, + denom_risk taler_amount, + denom_loss taler_amount, + deposit_start BIGINT, deposit_end BIGINT, - value taler_amount NOT NULL + value taler_amount ); COMMENT ON TABLE auditor_emergency IS 'Report an emergency denomination.'; diff --git a/src/auditordb/0002-auditor_emergency_by_count.sql b/src/auditordb/0002-auditor_emergency_by_count.sql index 41ff89cea..ff8ba405a 100644 --- a/src/auditordb/0002-auditor_emergency_by_count.sql +++ b/src/auditordb/0002-auditor_emergency_by_count.sql @@ -18,14 +18,13 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_emergency_by_count ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - denompub_h BYTEA NOT NULL, - num_issued BIGINT NOT NULL, - num_known BIGINT NOT NULL, - risk taler_amount NOT NULL, - start BIGINT NOT NULL, + denompub_h BYTEA, + num_issued BIGINT, + num_known BIGINT, + risk taler_amount, + start BIGINT, deposit_end BIGINT, - value taler_amount NOT NULL, + value taler_amount, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_emergency_by_count diff --git a/src/auditordb/0002-auditor_fee_time_inconsistency.sql b/src/auditordb/0002-auditor_fee_time_inconsistency.sql index 128204bc4..1cea6caa6 100644 --- a/src/auditordb/0002-auditor_fee_time_inconsistency.sql +++ b/src/auditordb/0002-auditor_fee_time_inconsistency.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_fee_time_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - fee_type BYTEA NOT NULL, - fee_time BIGINT NOT NULL, - diagnostic BYTEA NOT NULL, + type BYTEA, + time BIGINT, + diagnostic BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_fee_time_inconsistency diff --git a/src/auditordb/0002-auditor_historic_denomination_revenue.sql b/src/auditordb/0002-auditor_historic_denomination_revenue.sql index 8576387a4..d711ac7fc 100644 --- a/src/auditordb/0002-auditor_historic_denomination_revenue.sql +++ b/src/auditordb/0002-auditor_historic_denomination_revenue.sql @@ -16,7 +16,6 @@ CREATE TABLE auditor_historic_denomination_revenue (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) ,revenue_timestamp BIGINT NOT NULL ,revenue_balance taler_amount NOT NULL diff --git a/src/auditordb/0002-auditor_historic_reserve_summary.sql b/src/auditordb/0002-auditor_historic_reserve_summary.sql index 0c97befb2..0dc68d594 100644 --- a/src/auditordb/0002-auditor_historic_reserve_summary.sql +++ b/src/auditordb/0002-auditor_historic_reserve_summary.sql @@ -18,12 +18,12 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_historic_reserve_summary ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, - start_date BIGINT NOT NULL, + start_date BIGINT, end_date BIGINT NOT NULL, reserve_profits taler_amount NOT NULL, PRIMARY KEY (start_date, end_date) + ); COMMENT ON TABLE auditor_historic_reserve_summary IS 'historic profits from reserves; we eventually GC auditor_historic_reserve_revenue, and then store the totals in here (by time intervals).'; diff --git a/src/auditordb/0002-auditor_misattribution_in_inconsistency.sql b/src/auditordb/0002-auditor_misattribution_in_inconsistency.sql index d212f5768..48050412d 100644 --- a/src/auditordb/0002-auditor_misattribution_in_inconsistency.sql +++ b/src/auditordb/0002-auditor_misattribution_in_inconsistency.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_misattribution_in_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - amount taler_amount NOT NULL, - bank_row BIGINT NOT NULL, - reserve_pub BYTEA NOT NULL, + amount taler_amount, + bank_row BIGINT, + reserve_pub BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_misattribution_in_inconsistency diff --git a/src/auditordb/0002-auditor_pending_deposits.sql b/src/auditordb/0002-auditor_pending_deposits.sql index 847885e48..5cef7bf8c 100644 --- a/src/auditordb/0002-auditor_pending_deposits.sql +++ b/src/auditordb/0002-auditor_pending_deposits.sql @@ -17,10 +17,9 @@ CREATE TABLE IF NOT EXISTS auditor_pending_deposits ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - total_amount taler_amount NOT NULL, - wire_target_payto TEXT NOT NULL, - batch_deposit_serial_id BIGINT NOT NULL, - deadline BIGINT NOT NULL, + total_amount taler_amount, + wire_target_h_payto BYTEA, + batch_deposit_serial_id BIGINT, + deadline BIGINT, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); diff --git a/src/auditordb/0002-auditor_purse_not_closed_inconsistencies.sql b/src/auditordb/0002-auditor_purse_not_closed_inconsistencies.sql index 470f759c6..e7f6078f0 100644 --- a/src/auditordb/0002-auditor_purse_not_closed_inconsistencies.sql +++ b/src/auditordb/0002-auditor_purse_not_closed_inconsistencies.sql @@ -17,11 +17,10 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_purse_not_closed_inconsistencies ( - row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, - purse_pub BYTEA PRIMARY KEY NOT NULL, - amount taler_amount NOT NULL, - expiration_date BIGINT NOT NULL, + row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE , + purse_pub BYTEA PRIMARY KEY, + amount taler_amount, + expiration_date BIGINT, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_purse_not_closed_inconsistencies diff --git a/src/auditordb/0002-auditor_purses.sql b/src/auditordb/0002-auditor_purses.sql index 6a100fd6e..9cfe2b095 100644 --- a/src/auditordb/0002-auditor_purses.sql +++ b/src/auditordb/0002-auditor_purses.sql @@ -15,9 +15,8 @@ -- CREATE TABLE auditor_purses - (auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE NOT NULL - ,problem_row_id BIGINT NOT NULL - ,purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32) NOT NULL + (auditor_purses_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE + ,purse_pub BYTEA PRIMARY KEY CHECK(LENGTH(purse_pub)=32) ,balance taler_amount NOT NULL DEFAULT(0,0) ,target taler_amount NOT NULL ,expiration_date BIGINT NOT NULL diff --git a/src/auditordb/0002-auditor_refreshes_hanging.sql b/src/auditordb/0002-auditor_refreshes_hanging.sql index f9ef5b743..c42d17c6c 100644 --- a/src/auditordb/0002-auditor_refreshes_hanging.sql +++ b/src/auditordb/0002-auditor_refreshes_hanging.sql @@ -17,10 +17,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_refreshes_hanging ( - row_id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY UNIQUE, - problem_row_id BIGINT NOT NULL, - amount taler_amount NOT NULL, - coin_pub BYTEA PRIMARY KEY NOT NULL, + row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + amount taler_amount, + coin_pub BYTEA PRIMARY KEY, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_refreshes_hanging diff --git a/src/auditordb/0002-auditor_reserve_balance_insufficient_inconsistency.sql b/src/auditordb/0002-auditor_reserve_balance_insufficient_inconsistency.sql index 00ec2fee2..533f35681 100644 --- a/src/auditordb/0002-auditor_reserve_balance_insufficient_inconsistency.sql +++ b/src/auditordb/0002-auditor_reserve_balance_insufficient_inconsistency.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_reserve_balance_insufficient_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, reserve_pub BYTEA NOT NULL CHECK (LENGTH(reserve_pub)=32), - inconsistency_gain BOOLEAN NOT NULL, - inconsistency_amount taler_amount NOT NULL, + inconsistency_gain BOOLEAN, + inconsistency_amount taler_amount, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_reserve_balance_insufficient_inconsistency diff --git a/src/auditordb/0002-auditor_reserve_balance_summary_wrong_inconsistency.sql b/src/auditordb/0002-auditor_reserve_balance_summary_wrong_inconsistency.sql index bd99e1dc8..12618d101 100644 --- a/src/auditordb/0002-auditor_reserve_balance_summary_wrong_inconsistency.sql +++ b/src/auditordb/0002-auditor_reserve_balance_summary_wrong_inconsistency.sql @@ -18,10 +18,9 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_reserve_balance_summary_wrong_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - reserve_pub BYTEA NOT NULL, - exchange_amount taler_amount NOT NULL, - auditor_amount taler_amount NOT NULL, + reserve_pub BYTEA, + exchange_amount taler_amount, + auditor_amount taler_amount, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); COMMENT ON TABLE auditor_reserve_balance_summary_wrong_inconsistency diff --git a/src/auditordb/0002-auditor_reserve_not_closed_inconsistency.sql b/src/auditordb/0002-auditor_reserve_not_closed_inconsistency.sql index 7c588a34c..ef0381bd1 100644 --- a/src/auditordb/0002-auditor_reserve_not_closed_inconsistency.sql +++ b/src/auditordb/0002-auditor_reserve_not_closed_inconsistency.sql @@ -18,9 +18,8 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_reserve_not_closed_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE , - problem_row_id BIGINT NOT NULL, - reserve_pub BYTEA PRIMARY KEY NOT NULL, - balance taler_amount NOT NULL, + reserve_pub BYTEA PRIMARY KEY, + balance taler_amount, expiration_time BIGINT, diagnostic BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE diff --git a/src/auditordb/0002-auditor_reserves.sql b/src/auditordb/0002-auditor_reserves.sql index 9a7506b0f..f50653512 100644 --- a/src/auditordb/0002-auditor_reserves.sql +++ b/src/auditordb/0002-auditor_reserves.sql @@ -16,7 +16,6 @@ CREATE TABLE auditor_reserves (auditor_reserves_rowid BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE - ,problem_row_id BIGINT NOT NULL ,reserve_pub BYTEA PRIMARY KEY CHECK(LENGTH(reserve_pub)=32) ,reserve_balance taler_amount NOT NULL ,reserve_loss taler_amount NOT NULL diff --git a/src/auditordb/0002-auditor_row_inconsistency.sql b/src/auditordb/0002-auditor_row_inconsistency.sql index 195d33030..6fae517bf 100644 --- a/src/auditordb/0002-auditor_row_inconsistency.sql +++ b/src/auditordb/0002-auditor_row_inconsistency.sql @@ -18,7 +18,6 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_row_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, row_table TEXT NOT NULL, diagnostic TEXT NOT NULL, problem_row_id INT8 NOT NULL, diff --git a/src/auditordb/0002-auditor_wire_format_inconsistency.sql b/src/auditordb/0002-auditor_wire_format_inconsistency.sql index e77870a62..dc95f7956 100644 --- a/src/auditordb/0002-auditor_wire_format_inconsistency.sql +++ b/src/auditordb/0002-auditor_wire_format_inconsistency.sql @@ -18,9 +18,8 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_wire_format_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, - amount taler_amount NOT NULL, - wire_offset BIGINT NOT NULL, + amount taler_amount, + wire_offset BIGINT, diagnostic BYTEA, suppressed BOOLEAN NOT NULL DEFAULT FALSE ); diff --git a/src/auditordb/0002-auditor_wire_out_inconsistency.sql b/src/auditordb/0002-auditor_wire_out_inconsistency.sql index 9e605d068..d46c2b283 100644 --- a/src/auditordb/0002-auditor_wire_out_inconsistency.sql +++ b/src/auditordb/0002-auditor_wire_out_inconsistency.sql @@ -17,7 +17,6 @@ CREATE TABLE IF NOT EXISTS auditor_wire_out_inconsistency ( row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY, - problem_row_id BIGINT NOT NULL, destination_account TEXT NOT NULL, diagnostic TEXT NOT NULL, wire_out_serial_id INT8 NOT NULL, |