这是indexloc提供的服务,不要输入任何密码
Skip to content

Creating relationship failed. table not exists when creating manual relation #3022

@tafelito

Description

@tafelito

I have a table of users and a table followers with user_id and follower_id

I'm trying to create a view so I can see from a user who users he/she follows and also who follows him/her?

Table users

id
email

Table users_followers

id 
user_id FK --> users
follower_id FK --> users

To see the followers of a user, I created an array relationship followers on users table
users_followers . user_id → users . id

and then to be able to see who is following a user, I created the following view

CREATE VIEW following_me AS 
  SELECT u.id as user_id,
    u1.*
    FROM users u 
    LEFT JOIN users_followers f ON u.id = f.follower_id 
    INNER JOIN users u1 ON f.user_id = u1.id;

and then when I try to create a manual relation from the users table to the following_me view as a reference table (users.id --> following_me.user_id), even tho it does appear on the tables dropdown with all the correct fields, when I save, I get and error that says following_me table does not exists

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions