Change granter.sh to give permissions to user specified on command line
[hcoop/zz_old/portal.git] / tables.sql
index 7054c74..fc7a8cc 100644 (file)
@@ -35,6 +35,7 @@ CREATE TABLE WebUser(
        bal INTEGER NOT NULL,
        joined TIMESTAMP NOT NULL,
        app INTEGER NOT NULL,
+       shares INTEGER NOT NULL,
        FOREIGN KEY (bal) REFERENCES Balance(id) ON DELETE CASCADE,
        FOREIGN KEY (app) REFERENCES MemberApp(id) ON DELETE CASCADE);
 
@@ -248,15 +249,15 @@ CREATE TABLE AppVote(
        FOREIGN KEY (usr) REFERENCES WebUser(id) ON DELETE CASCADE);
 
 CREATE VIEW WebUserPaying
-       AS SELECT id, name, rname, bal, joined, app
+       AS SELECT id, name, rname, bal, joined, app, shares
                FROM WebUser
                        JOIN (SELECT usr FROM Membership JOIN WebGroup
                                ON grp = WebGroup.id
-                                       AND WebGroup.name = 'paying')
+                                       AND WebGroup.name = 'paying') AS bob
                                ON usr = WebUser.id;
 
 CREATE VIEW WebUserActive
-       AS SELECT id, name, rname, bal, joined, app
+       AS SELECT id, name, rname, bal, joined, app, shares
                FROM WebUser
                        LEFT OUTER JOIN (SELECT usr FROM Membership JOIN WebGroup
                                ON grp = WebGroup.id AND (WebGroup.name IN ('retired', 'phantom'))) AS mem