commit f1754f583edfb043018dc79bd6f02e3548bfb05d
parent a953722238bb97470deb674355e73fe629a772af
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
Date: Tue, 9 Jan 2024 10:44:27 +0100
fix sql
Diffstat:
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/donaudb/0002-donation_units.sql b/src/donaudb/0002-donation_units.sql
@@ -17,7 +17,7 @@
CREATE TABLE donation_units
(donation_unit_serial BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
,donation_unit_hash BYTEA PRIMARY KEY CHECK (LENGTH(donation_unit_hash)=64)
- ,donation_unit_pub BYTEA NOT NULL
+ ,donation_unit_pub BYTEA UNIQUE NOT NULL
,validity_year INT4 NOT NULL
,donation_unit taler_amount NOT NULL
);
diff --git a/src/donaudb/0002-donau_charities.sql b/src/donaudb/0002-donau_charities.sql
@@ -16,7 +16,7 @@
CREATE TABLE charities
(charity_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE
- ,charity_pub BYTEA PRIMARY KEY CHECK (LENGTH(donau_pub)=32)
+ ,charity_pub BYTEA PRIMARY KEY CHECK (LENGTH(charity_pub)=32)
,charity_name TEXT NOT NULL
,charity_url TEXT NOT NULL
,max_per_year taler_amount NOT NULL
diff --git a/src/donaudb/0002-donau_history.sql b/src/donaudb/0002-donau_history.sql
@@ -15,7 +15,7 @@
--
CREATE TABLE history
- (charity_id BIGINT KEY REFERENCES charities (charity_id) ON DELETE CASCADE
+ (charity_id BIGINT PRIMARY KEY REFERENCES charities (charity_id) ON DELETE CASCADE
,final_amount taler_amount NOT NULL
,donation_year INT8 NOT NULL
);