1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use crate::users::schema::users; table! { permissions (id) { id -> Unsigned<Bigint>, permission_name -> Varchar, } } table! { user_permissions (user_permission_id) { user_permission_id -> Unsigned<Bigint>, permission_id -> Unsigned<Bigint>, user_id -> Unsigned<Bigint>, } } joinable!(user_permissions -> permissions (permission_id)); joinable!(user_permissions -> users (user_id)); allow_tables_to_appear_in_same_query!(permissions, user_permissions, users,);