-
-
Save FCO/415e4de3ac20fbab7496a193af59a254 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model User { | |
has Int $.id is serial; | |
has Str $.name is column; | |
has Str $.role is column; | |
} | |
red-defaults "SQLite"; | |
schema(User).drop; | |
User.^create-table; | |
for <user admin root> -> $role { User.^create(:name("user " ~ ++$), :$role) } | |
submodel Admin of User where *.role eq "admin"; | |
say User.new(:a<admin>) ~~ User; | |
Admin.^create: :name("new admin"); | |
.say for Admin.^all; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment