DB: Referencing to own table column #10792
wpinfusion
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Creating a table where one column referenced to another column is possible, but it generates type errors in your IDE.
For example:
The use-case here is to allow parent/child relationships in
posts
(for example).The solution (by Fryuni) is to import the type:
And then use that in the table schema:
Beta Was this translation helpful? Give feedback.
All reactions