How to create a foreign key referencing to the same table in Strapi?

You can do this in the admin UI, when you add a field to a content type just select relation and then on the right hand side select the same content type.