# Pastebin 0NSSY3gQ use Red; model Comment { has UInt $!id is serial; has Str $.body is column; } model Post { has UInt $.id is serial; has Str $.title is unique; has Int $!comment-id is referencing{ :model, :column }; has @.comments is relationship( *.comment-id, :model ); } model Photo { has UInt $.id is serial; has Str $.path is unique; has Int $!comment-id is referencing{ :model, :column }; has @.comments is relationship( *.comment-id, :model ); } red-defaults "SQLite"; my $*RED-DEBUG = True; schema(Comment, Post, Photo).create; my $post = Post.^create: :title; $post.comments.append :body; my $photo = Photo.^create: :path; $photo.comments.append: :body;