X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/a2d53da2112ffeb95789a98038145bd4bebcbfcd..0b4db14f7226c2e419320aa1a5140056038ba0c3:/tables.sql

diff --git a/tables.sql b/tables.sql
index f0067e8..ccaca80 100644
--- a/tables.sql
+++ b/tables.sql
@@ -14,7 +14,9 @@ CREATE TABLE MemberApp(
 	confirmed TIMESTAMP,
 	decided TIMESTAMP,
 	msg TEXT NOT NULL,
-	unix_passwd TEXT NOT NULL);
+	unix_passwd TEXT NOT NULL,
+	paypal TEXT,
+	checkout TEXT);
 
 CREATE SEQUENCE MemberAppSeq START 1;
 
@@ -37,6 +39,8 @@ CREATE TABLE WebUser(
 	joined TIMESTAMP NOT NULL,
 	app INTEGER NOT NULL,
 	shares INTEGER NOT NULL,
+	paypal TEXT,
+	checkout TEXT
 	FOREIGN KEY (bal) REFERENCES Balance(id) ON DELETE CASCADE,
 	FOREIGN KEY (app) REFERENCES MemberApp(id) ON DELETE CASCADE);
 
@@ -100,6 +104,8 @@ CREATE TABLE Poll(
 	starts DATE NOT NULL,
 	ends DATE NOT NULL,
 	votes INTEGER NOT NULL,
+	official BOOL NOT NULL,
+	ready BOOL NOT NULL,
 	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
 
 CREATE SEQUENCE PollSeq START 1;
@@ -270,7 +276,7 @@ CREATE TABLE AppVote(
 	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
 
 CREATE VIEW WebUserPaying
-	AS SELECT id, name, rname, bal, joined, app, shares
+	AS SELECT id, name, rname, bal, joined, app, shares, paypal, checkout
 		FROM WebUser
 			JOIN (SELECT usr FROM Membership JOIN WebGroup
 				ON grp = WebGroup.id
@@ -278,7 +284,7 @@ CREATE VIEW WebUserPaying
 				ON usr = WebUser.id;
 
 CREATE VIEW WebUserActive
-	AS SELECT id, name, rname, bal, joined, app, shares
+	AS SELECT id, name, rname, bal, joined, app, shares, paypal, checkout
 		FROM WebUser
 			LEFT OUTER JOIN (SELECT usr FROM Membership JOIN WebGroup
 				ON grp = WebGroup.id AND (WebGroup.name IN ('retired', 'phantom'))) AS mem
@@ -338,7 +344,30 @@ CREATE TABLE Cert(
 	status INTEGER NOT NULL,
 	stamp TIMESTAMP NOT NULL,
 	cstamp TIMESTAMP,
-	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE,
-	FOREIGN KEY (node) REFERENCES WebNode(id) ON DELETE CASCADE);
+	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
 
 CREATE SEQUENCE CertSeq START 1;
+
+CREATE TABLE Sign(
+	id INTEGER PRIMARY KEY,
+	usr INTEGER NOT NULL,
+	data TEXT NOT NULL,
+	msg TEXT NOT NULL,
+	status INTEGER NOT NULL,
+	stamp TIMESTAMP NOT NULL,
+	cstamp TIMESTAMP,
+	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
+
+CREATE SEQUENCE SignSeq START 1;
+
+CREATE TABLE Quota(
+	id INTEGER PRIMARY KEY,
+	usr INTEGER NOT NULL,
+	data TEXT NOT NULL,
+	msg TEXT NOT NULL,
+	status INTEGER NOT NULL,
+	stamp TIMESTAMP NOT NULL,
+	cstamp TIMESTAMP,
+	FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
+
+CREATE SEQUENCE QuotaSeq START 1;
