~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to userdb/users.sql

  • Committer: wagrant
  • Date: 2008-08-09 05:00:50 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:996
common.db.get_enrolment_groups: Reorder parameters. I hate caching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
    login       VARCHAR UNIQUE NOT NULL,
6
6
    passhash    VARCHAR,
7
7
    state       VARCHAR NOT NULL CHECK (state in ('no_agreement', 'pending',
8
 
                                              'enabled', 'disabled'))
9
 
                                 DEFAULT 'no_agreement',
 
8
                                              'enabled', 'disabled')),
10
9
    rolenm      VARCHAR NOT NULL CHECK (rolenm in ('anyone', 'student',
11
10
                                                   'marker', 'tutor',
12
11
                                                   'lecturer', 'admin')),
98
97
        oid INTEGER;
99
98
    BEGIN
100
99
        SELECT offeringid INTO oid FROM project_set WHERE project_set.projectsetid = NEW.projectsetid;
101
 
        PERFORM 1 FROM project_group, project_set WHERE project_set.offeringid = oid AND project_group.projectsetid = project_set.projectsetid AND project_group.groupnm = NEW.groupnm;
 
100
        PERFORM 1 FROM project_group, project_set WHERE project_group.projectsetid = project_set.projectsetid AND project_group.groupnm = NEW.groupnm;
102
101
        IF found THEN
103
102
            RAISE EXCEPTION ''a project group named % already exists in offering ID %'', NEW.groupnm, oid;
104
103
        END IF;
246
245
    date        TIMESTAMP NOT NULL,
247
246
    attempt     VARCHAR NOT NULL,
248
247
    complete    BOOLEAN NOT NULL,
249
 
    active      BOOLEAN NOT NULL DEFAULT true,
250
248
    PRIMARY KEY (problemid,loginid,date)
251
249
);
252
250