     FOREIGN KEY (group_id) REFERENCES groups(group_id)
 );
 
--- Group Member Positions Table
-CREATE TABLE group_member_positions (
+-- Group Positions Table
+CREATE TABLE group_positions (
     pos_id      INT NOT NULL,
     group_id    INT NOT NULL,
     send        BOOLEAN DEFAULT FALSE, -- Toggles whether or not this position

-- House View
-- Because houses are used so much, make a view separate from the organizations
-- table.
CREATE VIEW org_houses AS (
    SELECT org_id, org_name FROM organizations WHERE type = 'house'
);

-- House Members View
-- Because house membership is used so much, make a view separate from the
-- positions table.
CREATE VIEW org_house_membership AS (
    SELECT user_id, org_id, pos_id
    FROM org_houses NATURAL JOIN positions NATURAL JOIN position_holders
    WHERE UPPER(pos_name) = UPPER('Full Member') 
        OR UPPER(pos_name) = UPPER('Social Member')
);

-- Groups Table
-- Groups of members. Used for mailing lists, etc.
-- Groups are very similar to organizations, but more for internal groupings
-- of users.
CREATE TABLE groups (
    group_id                INT          NOT NULL AUTO_INCREMENT,
    group_name              VARCHAR(32)  NOT NULL,
    group_desc              VARCHAR(255) DEFAULT NULL,
    anyone_can_send         BOOLEAN      DEFAULT FALSE, -- This flag controls
                                                        -- whether or not 
                                                        -- anyone can send
                                                        -- emails to the group
    newsgroups              BOOLEAN      DEFAULT FALSE, -- Controls if this is
                                                        -- an email group
    visible                 BOOLEAN      DEFAULT FALSE, -- Controls if anyone
                                                        -- anyone can see this
                                                        -- group
    admin_control_members   BOOLEAN      DEFAULT TRUE,  -- Toggles whether or
                                                        -- not admins control
                                                        -- Group membership
    PRIMARY KEY (group_id),
    UNIQUE (group_name)
);

-- Group Members Table

-- TODO: Better comments

DROP TABLE IF EXISTS group_members;
DROP TABLE IF EXISTS group_positions;
DROP TABLE IF EXISTS groups;
DROP VIEW IF EXISTS group_house_membership;
DROP VIEW IF EXISTS group_houses;
DROP TABLE IF EXISTS position_holders;
DROP TABLE IF EXISTS positions;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS privacies;
DROP TABLE IF EXISTS member_options; DROP TABLE IF EXISTS options; DROP VIEW IF EXISTS members_full_name; DROP TABLE IF EXISTS members; 
