Problem with FK references core.Users

LabKey Support Forum (Inactive)
Problem with FK references core.Users adam  2015-03-03 06:59
Status: Closed
 
You can't create an FK to core.Users because it's a view. Its definition in core-create.sql is:

    CREATE VIEW core.Users AS
        SELECT Principals.Name AS Email, UsersData.*, Principals.Active
        FROM core.Principals Principals
            INNER JOIN core.UsersData UsersData ON Principals.UserId = UsersData.UserId
        WHERE Type = 'u';

You probably want to define your FK to core.Principals(UserId) instead.

Adam