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

« back to all changes in this revision

Viewing changes to userdb/users.sql

Tutorial: Added a message, "no attempts have been made to this exercise",
    rather than displaying the empty box and View button.
    As a contingency, also fixed the View button - won't crash if there are no
    items in the list.

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')),
 
8
                                              'enabled', 'disabled'))
 
9
                                 DEFAULT 'no_agreement',
9
10
    rolenm      VARCHAR NOT NULL CHECK (rolenm in ('anyone', 'student',
10
11
                                                   'marker', 'tutor',
11
12
                                                   'lecturer', 'admin')),
97
98
        oid INTEGER;
98
99
    BEGIN
99
100
        SELECT offeringid INTO oid FROM project_set WHERE project_set.projectsetid = NEW.projectsetid;
100
 
        PERFORM 1 FROM project_group, project_set WHERE project_group.projectsetid = project_set.projectsetid AND project_group.groupnm = NEW.groupnm;
 
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;
101
102
        IF found THEN
102
103
            RAISE EXCEPTION ''a project group named % already exists in offering ID %'', NEW.groupnm, oid;
103
104
        END IF;