Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m2m #46

Open
myOmikron opened this issue May 20, 2023 · 0 comments
Open

m2m #46

myOmikron opened this issue May 20, 2023 · 0 comments
Assignees
Labels
v0.6 Relevant for next release

Comments

@myOmikron
Copy link
Member

Would be nice to have m2m relations with this syntax

#[derive(Model)]
pub struct Repo {
    #[rorm(id)]
    pub id: i64,

    #[rorm(m2m, on_update = "Cascade", on_delete = "Cascade")]
    pub owners: Many2Many<m2m!(User::F.repos)>,
}

#[derive(Model)]
pub struct User {
    #[rorm(id)]
    pub id: i64,

    #[rorm(m2m, on_update = "Cascade", on_delete = "Cascade")]
    pub repos: Many2Many<m2m!(Repo::F.owners)>,
}
@myOmikron myOmikron added the v0.6 Relevant for next release label May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.6 Relevant for next release
Projects
None yet
Development

No branches or pull requests

2 participants