Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to link to self? #942

Open
Josh5A opened this issue May 31, 2024 · 1 comment
Open

Best way to link to self? #942

Josh5A opened this issue May 31, 2024 · 1 comment

Comments

@Josh5A
Copy link

Josh5A commented May 31, 2024

Hello,

I'm not sure where to ask this question. Can RedBean do many-to-many self references? I have a table of articles and I need to record which ones will link to others internally.

So I want to be able to do something like $article→sharedArticleList.

In the database, the table I want is:
CREATE TABLE article_article (
article_id1 INT NOT NULL,
article_id2 INT NOT NULL,
PRIMARY KEY(article_id1, article_id2)
);

@Lynesth
Copy link
Collaborator

Lynesth commented May 31, 2024

You should be able to do it as you'd do any other shared lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants