ENUM
is not the right tool for this task.
You're describing a foreign key constraint:
CREATE TABLE groups (
ID SERIAL,
GroupName VARCHAR(255),
PermissionNodes VARCHAR(255), -- not sure what datatype this should be
Inheritance VARCHAR(255) -- nor this
) ENGINE = InnoDB;
CREATE TABLE users (
ID SERIAL,
Email VARCHAR(255),
Password CHAR(60) BINARY,
PermissionGroup BIGINT UNSIGNED,
FOREIGN KEY (PermissionGroup) REFERENCES groups (ID)
) ENGINE = InnoDB;
Note that the foreign key normally references the primary key of the parent table. If one wants to obtain the GroupName
of a user's group, one would simply join the tables:
SELECT users.*, groups.GroupName
FROM users JOIN groups ON groups.ID = users.PermissionGroup